arkhn / jpaltime

Apache License 2.0
0 stars 0 forks source link

Add a resource model for permission-status SearchParameter #11

Closed simonvadee closed 2 years ago

simonvadee commented 3 years ago

https://www.smilecdr.com/our-blog/custom-search-parameters-in-hapi-fhir here's the StructureDef:

{
  "resourceType": "SearchParameter",
  "id": "12002",
  "meta": {
    "versionId": "1",
    "lastUpdated": "2021-03-30T09:13:15.485+00:00",
    "source": "#wYdjYLDxnmCKQ6Bg"
  },
  "url": "http://arkhn.com/fhir/cohort360/SearchParameter/PermissionStatus",
  "name": "PERMISSION-STATUS-SEARCH-PARAMETER",
  "status": "active",
  "description": "Search PractitionerRole depending on permission status extension",
  "code": "permission-status",
  "base": [
    "PractitionerRole"
  ],
  "type": "token",
  "expression": "PractitionerRole.extension('http://arkhn.com/fhir/cohort360/StructureDefinition/permission-status')",
  "xpath": "f:PractitionerRole/f:extension[@url='http://arkhn.com/fhir/cohort360/StructureDefinition/permission-status']",
  "xpathUsage": "normal"
}

right now in SearchNarrowingInterceptor, we only want to search for "active" PractitionerRole but the searchparameter is custom since it's defined on one of our extension.

      IBundleProvider rolesForPractitioner = practitionerRoleDao
            .search(new SearchParameterMap().add(PractitionerRole.SP_PRACTITIONER, new ReferenceParam(practitionerId))
                  .add("permission-status", new TokenParam("active")));

we want to add the HAPI FHIR java model into jpaltime codebase so we don't have to use custom strings

simonvadee commented 2 years ago

This was used in the resah project but not anymore.