Skip to content

Commit

Permalink
Document Selector Fix (#214)
Browse files Browse the repository at this point in the history
* Add H2 tab

* Refine sub-criteria

* Resolve merge conflict

* Fix manual validation on tests that did not require it

* Fix pending displayed when successful response already generated

* Fix H2 subgroups

* Fix receive tab

* Minor fixes to fixed endpoints and H2 subgroups

* Fix incorrect endpoint display

* Fix sub-criteria selection and MT test accept/reject buttons

* Add tests to sendEdgeTests

* Fix pending status after refresh

* Add criteriaMet type manual

* Remove duplicate

* Fix issues for HISP tabs

* Fix XDR Test 16 and 17

* Fix XDR receiver test cases

* Fix document selector to use right endpoint

---------

Co-authored-by: ebrockainq <ebrock@ainq.com>
Co-authored-by: ebrockainq <112428189+ebrockainq@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 5, 2024
1 parent 99ebbce commit a83758a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
9 changes: 5 additions & 4 deletions src/components/direct/hisp/DocumentSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ interface DocumentSelectorProps {
onConfirm: (selectedData: { directory: string; fileName: string; fileLink: string }) => void
onClose: () => void
receive: boolean
protocol: string
}

export interface FileDetail {
Expand All @@ -37,7 +38,7 @@ export interface Directory {
files: FileDetail[]
}

const DocumentSelector = ({ onConfirm, onClose, receive: receive }: DocumentSelectorProps) => {
const DocumentSelector = ({ onConfirm, onClose, receive: receive, protocol }: DocumentSelectorProps) => {
const [open, setOpen] = useState(true)
const [documents, setDocuments] = useState<Documents>({})
const [selectedType, setSelectedType] = useState('cures')
Expand All @@ -46,9 +47,9 @@ const DocumentSelector = ({ onConfirm, onClose, receive: receive }: DocumentSele

useEffect(() => {
if (selectedType) {
fetchCCDADocuments(receive).then(setDocuments).catch(console.error)
fetchCCDADocuments(protocol).then(setDocuments).catch(console.error)
}
}, [selectedType, receive])
}, [selectedType, protocol])

interface FileDetail {
svap: boolean
Expand Down Expand Up @@ -105,7 +106,7 @@ const DocumentSelector = ({ onConfirm, onClose, receive: receive }: DocumentSele

const documentType = receive
? selectedType === 'cures'
? 'Receiver SUT Test Data'
? 'Cures Update Receiver SUT Test Data'
: 'Cures Update Svap Uscdiv3 Receiver SUT Test Data'
: selectedType === 'cures'
? 'Cures Update Sender SUT Test Data'
Expand Down
1 change: 1 addition & 0 deletions src/components/direct/hisp/TestCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ const TestCard = ({
onConfirm={handleDocumentConfirm}
onClose={handleDocumentSelectorClose}
receive={test.sutRole === 'receiver'}
protocol={test.protocol || ''}
/>
)}
{_.has(test, 'fields') &&
Expand Down
1 change: 1 addition & 0 deletions src/components/direct/hisp/XDRTestCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,7 @@ const TestCard = ({ test }: TestCardProps) => {
onConfirm={handleDocumentConfirm}
onClose={handleDocumentSelectorClose}
receive={test.sutRole === 'receiver'}
protocol={test.name?.includes('XDR') ? 'xdr' : ''}
/>
)}

Expand Down
10 changes: 6 additions & 4 deletions src/components/direct/test-by-criteria/ServerActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,12 @@ export async function GetStatus(testCaseId: string): Promise<StatusResponse> {
}
}

export async function fetchCCDADocuments(receive: boolean): Promise<Documents> {
const baseUrl = receive
? process.env.CCDA_DOCUMENTS_XDR || 'https://ett.healthit.gov/ett/api/ccdadocuments?testCaseType=xdr'
: process.env.CCDA_DOCUMENTS || 'https://ett.healthit.gov/ett/api/ccdadocuments?testCaseType'
export async function fetchCCDADocuments(protocol: string): Promise<Documents> {
console.log(protocol)
const baseUrl =
protocol === 'xdr'
? process.env.CCDA_DOCUMENTS_XDR || 'https://ett.healthit.gov/ett/api/ccdadocuments?testCaseType=xdr'
: process.env.CCDA_DOCUMENTS || 'https://ett.healthit.gov/ett/api/ccdadocuments?testCaseType'

const config = {
method: 'get',
Expand Down

0 comments on commit a83758a

Please sign in to comment.