Search in sources :

Example 16 with RCMRMT030101UK04CompoundStatement

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

the class ResourceFilterUtilTest method testIsNotSpecimenResource.

@ParameterizedTest
@MethodSource("nonSpecimenTestFiles")
public void testIsNotSpecimenResource(String inputXML) {
    final RCMRMT030101UK04CompoundStatement compoundStatement = unmarshallCompoundStatementElement(inputXML);
    assertThat(ResourceFilterUtil.isSpecimen(compoundStatement)).isFalse();
}
Also used : RCMRMT030101UK04CompoundStatement(org.hl7.v3.RCMRMT030101UK04CompoundStatement) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 17 with RCMRMT030101UK04CompoundStatement

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

the class ResourceFilterUtilTest method testIsBloodPressureResource.

@Test
public void testIsBloodPressureResource() {
    final RCMRMT030101UK04CompoundStatement compoundStatement = unmarshallCompoundStatementElement("blood_pressure_resource.xml");
    assertThat(ResourceFilterUtil.isBloodPressure(compoundStatement)).isTrue();
}
Also used : RCMRMT030101UK04CompoundStatement(org.hl7.v3.RCMRMT030101UK04CompoundStatement) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 18 with RCMRMT030101UK04CompoundStatement

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

the class ResourceFilterUtilTest method testIsAllergyIntoleranceResource.

@Test
public void testIsAllergyIntoleranceResource() {
    final RCMRMT030101UK04CompoundStatement compoundStatement = unmarshallCompoundStatementElement("allergy_intolerance_resource.xml");
    assertThat(ResourceFilterUtil.isAllergyIntolerance(compoundStatement)).isTrue();
}
Also used : RCMRMT030101UK04CompoundStatement(org.hl7.v3.RCMRMT030101UK04CompoundStatement) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 19 with RCMRMT030101UK04CompoundStatement

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

the class ResourceFilterUtilTest method testIsSpecimenResource.

@Test
public void testIsSpecimenResource() {
    final RCMRMT030101UK04CompoundStatement compoundStatement = unmarshallCompoundStatementElement("specimen_resource.xml");
    assertThat(ResourceFilterUtil.isSpecimen(compoundStatement)).isTrue();
}
Also used : RCMRMT030101UK04CompoundStatement(org.hl7.v3.RCMRMT030101UK04CompoundStatement) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 20 with RCMRMT030101UK04CompoundStatement

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

the class SpecimenCompoundsMapper method handleObservationStatement.

private void handleObservationStatement(RCMRMT030101UK04CompoundStatement specimenCompoundStatement, Observation observation, DiagnosticReport diagnosticReport) {
    final Reference specimenReference = new Reference(new IdType(Specimen.name(), specimenCompoundStatement.getId().get(0).getRoot()));
    observation.setSpecimen(specimenReference);
    observation.addCategory(createCategory());
    if (!containsReference(diagnosticReport.getResult(), observation.getId())) {
        diagnosticReport.addResult(new Reference(observation));
    }
}
Also used : Reference(org.hl7.fhir.dstu3.model.Reference) IdType(org.hl7.fhir.dstu3.model.IdType)

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