@@ -260,6 +260,20 @@ def create_coverage_read_search_capability(group,
260260 protected_resources = json .dumps (pr , indent = 4 ))
261261 return c
262262
263+ def create_insurance_card_capability (group , fhir_prefix , title = "Digital Insurance Card access." ):
264+ c = None
265+ description = "Digital Insurance Card"
266+ # TODO - this is not a real FHIR resource or scope, decision on how we want ot handle this
267+ smart_scope_string = "patient/DigitalInsuranceCard.read"
268+ pr = []
269+ pr .append (["GET" , "%sDigitalInsuranceCard[/]?$" % fhir_prefix ])
270+ if not ProtectedCapability .objects .filter (slug = smart_scope_string ).exists ():
271+ c = ProtectedCapability .objects .create (group = group ,
272+ title = title ,
273+ description = description ,
274+ slug = smart_scope_string ,
275+ protected_resources = json .dumps (pr , indent = 4 ))
276+ return c
263277
264278def create_launch_capability (group , fhir_prefix , title = "Patient launch context." ):
265279
@@ -296,5 +310,6 @@ def handle(self, *args, **options):
296310 create_coverage_read_capability (g , fhir_prefix )
297311 create_coverage_search_capability (g , fhir_prefix )
298312 create_coverage_read_search_capability (g , fhir_prefix )
313+ create_insurance_card_capability (g , fhir_prefix )
299314 create_launch_capability (g , fhir_prefix )
300315 create_openid_capability (g )
0 commit comments