File tree Expand file tree Collapse file tree 1 file changed +38
-2
lines changed
service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper Expand file tree Collapse file tree 1 file changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -442,7 +442,7 @@ void When_WithNonSnomedCodingWithDescriptionExtensionWithoutDisplay_Expect_Snome
442442 "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid",
443443 "extension": [
444444 {
445- "url": "descriptionId ",
445+ "url": "descriptioÍnId ",
446446 "valueId": "12345789"
447447 }
448448 ]
@@ -520,7 +520,43 @@ void When_WithNonSnomedCodingWithNoDisplayNoTextAndDescriptionExtensionNoDisplay
520520 "extension": [
521521 {
522522 "url": "descriptionId",
523- "valueId": "12345789"
523+ "valueString": "123456789"
524+ }
525+ ]
526+ }
527+ ]
528+ }
529+ ]
530+ }
531+ }""" ;
532+
533+ var expectedOutput = """
534+ <code nullFlavor="UNK">
535+ </code>""" ;
536+ var codeableConcept = fhirParseService .parseResource (inputJson , Observation .class ).getCode ();
537+
538+ var outputMessage = codeableConceptCdMapper .mapToNullFlavorCodeableConcept (codeableConcept );
539+
540+ assertThat (outputMessage ).isEqualToIgnoringWhitespace (expectedOutput );
541+ }
542+
543+ @ Test
544+ void When_WithSnomedCodingNoTextNoDisplayWithDescriptionExtensionWithDisplayExtension_Expect_SnomedCdXmlWithoutOriginalText () {
545+ var inputJson = """
546+ {
547+ "resourceType": "Observation",
548+ "code": {
549+ "coding": [
550+ {
551+ "system": "http://snomed.info/sct",
552+ "code": "852471000000107",
553+ "extension": [
554+ {
555+ "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid",
556+ "extension": [
557+ {
558+ "url": "descriptionDisplay",
559+ "valueString": "Prothrombin time (observed)"
524560 }
525561 ]
526562 }
You can’t perform that action at this time.
0 commit comments