2121 ContentStabilityExtensionCoding ,
2222 ContentStabilityExtensionValueCodeableConcept ,
2323 DocumentReference ,
24+ NRLRetrievalMechanismExtension ,
25+ NRLRetrievalMechanismExtensionCoding ,
26+ NRLRetrievalMechanismExtensionValueCodeableConcept ,
2427 OperationOutcomeIssue ,
2528 RequestQueryType ,
26- RetrievalMechanismExtension ,
27- RetrievalMechanismExtensionCoding ,
28- RetrievalMechanismExtensionValueCodeableConcept ,
2929)
3030from nrlf .tests .data import load_document_reference_json
3131
@@ -1379,11 +1379,11 @@ def test_validate_content_extension_missing_content_stability():
13791379 # Remove all ContentStability extensions
13801380 document_ref_data ["content" ][0 ]["extension" ] = [
13811381 {
1382- "url" : "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-RetrievalMechanism " ,
1382+ "url" : "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-NRLRetrievalMechanism " ,
13831383 "valueCodeableConcept" : {
13841384 "coding" : [
13851385 {
1386- "system" : "https://fhir.nhs.uk/England/CodeSystem/England-RetrievalMechanism " ,
1386+ "system" : "https://fhir.nhs.uk/England/CodeSystem/England-NRLRetrievalMechanism " ,
13871387 "code" : "Direct" ,
13881388 "display" : "Direct" ,
13891389 }
@@ -1421,11 +1421,11 @@ def test_validate_content_extension_mismatch_between_retrieval_mechanism_display
14211421 # Add a retrieval mechanism extension with a valid code but wrong display
14221422 document_ref_data ["content" ][0 ]["extension" ].append (
14231423 {
1424- "url" : "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-RetrievalMechanism " ,
1424+ "url" : "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-NRLRetrievalMechanism " ,
14251425 "valueCodeableConcept" : {
14261426 "coding" : [
14271427 {
1428- "system" : "https://fhir.nhs.uk/England/CodeSystem/England-RetrievalMechanism " ,
1428+ "system" : "https://fhir.nhs.uk/England/CodeSystem/England-NRLRetrievalMechanism " ,
14291429 "code" : "Direct" ,
14301430 "display" : "Spine Secure Proxy" ,
14311431 }
@@ -1604,11 +1604,11 @@ def test_validate_content_multiple_content_retrieval_extensions():
16041604
16051605 # Add 2 content retrieval extensions
16061606 content_retrieval_extension = {
1607- "url" : "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-RetrievalMechanism " ,
1607+ "url" : "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-NRLRetrievalMechanism " ,
16081608 "valueCodeableConcept" : {
16091609 "coding" : [
16101610 {
1611- "system" : "https://fhir.nhs.uk/England/CodeSystem/England-RetrievalMechanism " ,
1611+ "system" : "https://fhir.nhs.uk/England/CodeSystem/England-NRLRetrievalMechanism " ,
16121612 "code" : "Direct" ,
16131613 "display" : "Direct" ,
16141614 }
@@ -1634,7 +1634,7 @@ def test_validate_content_multiple_content_retrieval_extensions():
16341634 }
16351635 ]
16361636 },
1637- "diagnostics" : "Invalid content retrieval extension: Extension must have one content retrieval extension, see: ('https://fhir.nhs.uk/England/ValueSet/England-RetrievalMechanism ')" ,
1637+ "diagnostics" : "Invalid content retrieval extension: Extension must have one content retrieval extension, see: ('https://fhir.nhs.uk/England/ValueSet/England-NRLRetrievalMechanism ')" ,
16381638 "expression" : ["content[0].extension" ],
16391639 }
16401640
@@ -1672,11 +1672,11 @@ def test_validate_two_content_with_different_retrieval_mechanisms():
16721672 "format" : unstructured_format ,
16731673 "extension" : [
16741674 {
1675- "url" : "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-RetrievalMechanism " ,
1675+ "url" : "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-NRLRetrievalMechanism " ,
16761676 "valueCodeableConcept" : {
16771677 "coding" : [
16781678 {
1679- "system" : "https://fhir.nhs.uk/England/CodeSystem/England-RetrievalMechanism " ,
1679+ "system" : "https://fhir.nhs.uk/England/CodeSystem/England-NRLRetrievalMechanism " ,
16801680 "code" : "SSP" ,
16811681 "display" : "Spine Secure Proxy" ,
16821682 }
@@ -1713,11 +1713,11 @@ def test_validate_two_content_with_different_retrieval_mechanisms():
17131713 "format" : unstructured_format ,
17141714 "extension" : [
17151715 {
1716- "url" : "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-RetrievalMechanism " ,
1716+ "url" : "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-NRLRetrievalMechanism " ,
17171717 "valueCodeableConcept" : {
17181718 "coding" : [
17191719 {
1720- "system" : "https://fhir.nhs.uk/England/CodeSystem/England-RetrievalMechanism " ,
1720+ "system" : "https://fhir.nhs.uk/England/CodeSystem/England-NRLRetrievalMechanism " ,
17211721 "code" : "Direct" ,
17221722 "display" : "Direct" ,
17231723 }
@@ -1737,17 +1737,17 @@ def test_validate_two_content_with_different_retrieval_mechanisms():
17371737
17381738
17391739def test_validate_content_retrieval_lowercase_urls ():
1740- """Test that the extension is recognised when 'RetrievalMechanism ' is in lowercase and throws an error for mismatching the URL case."""
1740+ """Test that the extension is recognised when 'NRLRetrievalMechanism ' is in lowercase and throws an error for mismatching the URL case."""
17411741 validator = DocumentReferenceValidator ()
17421742 document_ref_data = load_document_reference_json ("Y05868-736253002-Valid" )
17431743
17441744 document_ref_data ["content" ][0 ]["extension" ] = [
17451745 {
1746- "url" : "https://fhir.nhs.uk/england/structuredefinition/extension-england-retrievalmechanism " ,
1746+ "url" : "https://fhir.nhs.uk/england/structuredefinition/extension-england-nrlretrievalmechanism " ,
17471747 "valueCodeableConcept" : {
17481748 "coding" : [
17491749 {
1750- "system" : "https://fhir.nhs.uk/England/CodeSystem/England-RetrievalMechanism " ,
1750+ "system" : "https://fhir.nhs.uk/England/CodeSystem/England-NRLRetrievalMechanism " ,
17511751 "code" : "Direct" ,
17521752 "display" : "Direct" ,
17531753 }
@@ -1784,7 +1784,7 @@ def test_validate_content_retrieval_lowercase_urls():
17841784 }
17851785 ]
17861786 },
1787- "diagnostics" : "Invalid content retrieval extension (content[0].extension[0].url: Input should be 'https://fhir.nhs.uk/England/StructureDefinition/Extension-England-RetrievalMechanism ', see: https://fhir.nhs.uk/England/ValueSet/England-RetrievalMechanism )" ,
1787+ "diagnostics" : "Invalid content retrieval extension (content[0].extension[0].url: Input should be 'https://fhir.nhs.uk/England/StructureDefinition/Extension-England-NRLRetrievalMechanism ', see: https://fhir.nhs.uk/England/ValueSet/England-NRLRetrievalMechanism )" ,
17881788 "expression" : ["content[0].extension[0].url" ],
17891789 }
17901790
@@ -1805,12 +1805,12 @@ def make_content_stability_extension(code, display):
18051805
18061806
18071807def make_retrieval_mechanism_extension (code , display ):
1808- return RetrievalMechanismExtension (
1809- url = "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-RetrievalMechanism " ,
1810- valueCodeableConcept = RetrievalMechanismExtensionValueCodeableConcept (
1808+ return NRLRetrievalMechanismExtension (
1809+ url = "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-NRLRetrievalMechanism " ,
1810+ valueCodeableConcept = NRLRetrievalMechanismExtensionValueCodeableConcept (
18111811 coding = [
1812- RetrievalMechanismExtensionCoding (
1813- system = "https://fhir.nhs.uk/England/CodeSystem/England-RetrievalMechanism " ,
1812+ NRLRetrievalMechanismExtensionCoding (
1813+ system = "https://fhir.nhs.uk/England/CodeSystem/England-NRLRetrievalMechanism " ,
18141814 code = code ,
18151815 display = display ,
18161816 )
@@ -1837,7 +1837,7 @@ def test_has_valid_extensions_multiple_retrieval_mechanism():
18371837 ]
18381838 assert validator ._has_valid_extensions (extensions , 0 ) is False
18391839 assert any (
1840- "Invalid content retrieval extension: Extension must have one content retrieval extension, see: ('https://fhir.nhs.uk/England/ValueSet/England-RetrievalMechanism ')"
1840+ "Invalid content retrieval extension: Extension must have one content retrieval extension, see: ('https://fhir.nhs.uk/England/ValueSet/England-NRLRetrievalMechanism ')"
18411841 in issue .diagnostics
18421842 for issue in validator .result .issues
18431843 )
@@ -1927,11 +1927,11 @@ def test_validate_structured_format_with_text_html_for_incontext_launch():
19271927 }
19281928 document_ref_data ["content" ][0 ]["extension" ] = [
19291929 {
1930- "url" : "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-RetrievalMechanism " ,
1930+ "url" : "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-NRLRetrievalMechanism " ,
19311931 "valueCodeableConcept" : {
19321932 "coding" : [
19331933 {
1934- "system" : "https://fhir.nhs.uk/England/CodeSystem/England-RetrievalMechanism " ,
1934+ "system" : "https://fhir.nhs.uk/England/CodeSystem/England-NRLRetrievalMechanism " ,
19351935 "code" : "InContext" ,
19361936 "display" : "Direct using In-Context" ,
19371937 }
0 commit comments