Search in sources :

Example 21 with RCMRMT030101UK04CompoundStatement

use of org.hl7.v3.RCMRMT030101UK04CompoundStatement in project nia-patient-switching-standard-adaptor by NHSDigital.

the class EncounterMapper method generateStructuredConsultation.

private void generateStructuredConsultation(List<RCMRMT030101UK04CompoundStatement> topicCompoundStatementList, RCMRMT030101UK04EhrComposition ehrComposition, ListResource consultation, List<ListResource> topics, List<ListResource> categories) {
    topicCompoundStatementList.forEach(topicCompoundStatement -> {
        var topic = consultationListMapper.mapToTopic(consultation, topicCompoundStatement);
        consultation.addEntry(new ListEntryComponent(new Reference(topic)));
        generateCategoryLists(topicCompoundStatement, topic, categories);
        generateLinkSetTopicLists(ehrComposition, consultation, topics);
        topics.add(topic);
    });
}
Also used : Reference(org.hl7.fhir.dstu3.model.Reference) ListEntryComponent(org.hl7.fhir.dstu3.model.ListResource.ListEntryComponent)

Example 22 with RCMRMT030101UK04CompoundStatement

use of org.hl7.v3.RCMRMT030101UK04CompoundStatement in project nia-patient-switching-standard-adaptor by NHSDigital.

the class ResourceReferenceUtilTest method testMedicationResourcesReferencedAtCompoundStatementLevel.

@Test
public void testMedicationResourcesReferencedAtCompoundStatementLevel() {
    final RCMRMT030101UK04CompoundStatement compoundStatement = unmarshallCompoundStatementElement("compound_statement_medication.xml");
    List<Reference> references = new ArrayList<>();
    resourceReferenceUtil.extractChildReferencesFromCompoundStatement(compoundStatement, references);
    assertThat(references.size()).isEqualTo(THREE);
    assertThat(references.get(0).getReference()).isEqualTo("MedicationStatement/A0A70B62-2649-4C8F-B3AB-618B8257C942-MS");
    assertThat(references.get(1).getReference()).isEqualTo("MedicationRequest/A0A70B62-2649-4C8F-B3AB-618B8257C942");
    assertThat(references.get(2).getReference()).isEqualTo("MedicationRequest/9B4B797A-D674-4362-B666-2ADC8551EEDA");
}
Also used : RCMRMT030101UK04CompoundStatement(org.hl7.v3.RCMRMT030101UK04CompoundStatement) Reference(org.hl7.fhir.dstu3.model.Reference) ArrayList(java.util.ArrayList) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 23 with RCMRMT030101UK04CompoundStatement

use of org.hl7.v3.RCMRMT030101UK04CompoundStatement in project nia-patient-switching-standard-adaptor by NHSDigital.

the class ConsultationListMapperTest method setUpCompoundStatement.

private RCMRMT030101UK04CompoundStatement setUpCompoundStatement(String originalText, String display, String availabilityTime, boolean nullFlavorCode) {
    RCMRMT030101UK04CompoundStatement compoundStatement = new RCMRMT030101UK04CompoundStatement();
    II id = new II();
    id.setRoot(COMPOUND_STATEMENT_ID);
    CD cd = new CD();
    if (nullFlavorCode) {
        cd.setNullFlavor(CsNullFlavor.UNK);
    } else {
        cd.setOriginalText(originalText);
        cd.setDisplayName(display);
        cd.setCodeSystem("2.16.840.1.113883.2.1.6.2");
        cd.setCode("14L..00");
    }
    TS ts = new TS();
    if (availabilityTime != null) {
        ts.setValue(availabilityTime);
    } else {
        ts.setNullFlavor(CsNullFlavor.NI);
    }
    compoundStatement.setAvailabilityTime(ts);
    compoundStatement.getId().add(id);
    compoundStatement.setCode(cd);
    return compoundStatement;
}
Also used : II(org.hl7.v3.II) CD(org.hl7.v3.CD) RCMRMT030101UK04CompoundStatement(org.hl7.v3.RCMRMT030101UK04CompoundStatement) TS(org.hl7.v3.TS)

Aggregations

RCMRMT030101UK04CompoundStatement (org.hl7.v3.RCMRMT030101UK04CompoundStatement)14 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)13 Reference (org.hl7.fhir.dstu3.model.Reference)10 Test (org.junit.jupiter.api.Test)7 MethodSource (org.junit.jupiter.params.provider.MethodSource)6 ArrayList (java.util.ArrayList)4 ListResource (org.hl7.fhir.dstu3.model.ListResource)2 ListEntryComponent (org.hl7.fhir.dstu3.model.ListResource.ListEntryComponent)2 ParticipantReferenceUtil.getParticipantReference (uk.nhs.adaptors.pss.translator.util.ParticipantReferenceUtil.getParticipantReference)2 DiagnosticReport (org.hl7.fhir.dstu3.model.DiagnosticReport)1 IdType (org.hl7.fhir.dstu3.model.IdType)1 Observation (org.hl7.fhir.dstu3.model.Observation)1 QuestionnaireResponse (org.hl7.fhir.dstu3.model.QuestionnaireResponse)1 Specimen (org.hl7.fhir.dstu3.model.Specimen)1 UriType (org.hl7.fhir.dstu3.model.UriType)1 CD (org.hl7.v3.CD)1 II (org.hl7.v3.II)1 TS (org.hl7.v3.TS)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1 ResourceUtil.addContextToObservation (uk.nhs.adaptors.pss.translator.util.ResourceUtil.addContextToObservation)1