2020
2121
2222def fhir_conformance_v2 (request , via_oauth = False ):
23- return fhir_conformance (request , via_oauth , True )
23+ return fhir_conformance (request , via_oauth , "v2" )
2424
2525
26- def fhir_conformance (request , via_oauth = False , v2 = False , * args ):
26+ def fhir_conformance_v3 (request , via_oauth = False ):
27+ return fhir_conformance (request , via_oauth , "v3" )
28+
29+
30+ def fhir_conformance (request , via_oauth = False , ver_str = "v1" , * args ):
2731 """ Pull and filter fhir Conformance statement
2832
2933 BaseStu3 = "CapabilityStatement"
@@ -36,13 +40,14 @@ def fhir_conformance(request, via_oauth=False, v2=False, *args):
3640 """
3741 crosswalk = None
3842 resource_router = get_resourcerouter ()
39- parsed_url = urlparse (resource_router .fhir_url )
43+ fhir_url = resource_router .fhir_url_v3 if ver_str == "v3" else resource_router .fhir_url
44+ parsed_url = urlparse (fhir_url )
4045 call_to = None
4146 if parsed_url .path is not None :
42- call_to = '{}://{}/{}/fhir/metadata' .format (parsed_url .scheme , parsed_url .netloc , 'v2' if v2 else 'v1' )
47+ call_to = '{}://{}/{}/fhir/metadata' .format (parsed_url .scheme , parsed_url .netloc , ver_str )
4348 else :
4449 # url with no path
45- call_to = '{}/{}/fhir/metadata' .format (resource_router . fhir_url , 'v2' if v2 else 'v1' )
50+ call_to = '{}/{}/fhir/metadata' .format (fhir_url , ver_str )
4651
4752 pass_params = {'_format' : 'json' }
4853
0 commit comments