Closed qiarie closed 2 months ago
@qiarie can you please update or remove the Additional context, Acceptance criteria, and Area path
For (1.) this is to add in tests and the docs, no where in the code, is that correct?
For (2.) what happens when there are >1 IGs with the same app ID, version
, and useContext.valueRange
?
For (1.), (2.), and (3.) can you describe how to define the IG .url
so that the client knows how to construct that URL from the app ID?
For (1.) this is to add in tests and the docs, no where in the code, is that correct?
For (2.) what happens when there are >1 IGs with the same app ID,
version
, anduseContext.valueRange
?For (1.), (2.), and (3.) can you describe how to define the IG
.url
so that the client knows how to construct that URL from the app ID?
@qiarie for (2.) the question still stands, what happens if there are >1 IGs with the same app ID (as defined in the URL), version, and useContext.valueRange?
@pld The IG URL field is meant to be globally unique. From discussions, we'd agreed to create a copy of the IG with a different identifier (URL in this case) for updates. This way the conflict of multiple IGs for the same app is resolved. The IG URL in the application config would then be updated to the new one.
Is the global uniqueness enforced, i.e. if you to a POST/PUT with a duplicate URL is it rejected?
@pld I will run a confirmation test and update
@pld It is possible to post multiple IGs with the same URL. We can have the URL reference the app and query with it. We can then combine the URL with the version to fetch the specific IG for the app version.
@qiarie How do you intend to include the IG URL in ApplicationConfiguration
that is referenced via the Composition
resource? The ApplicationConfiguration
is only downloaded once the Composition resource is synced.
@pld @ellykits After further discussions we've settled on using the name
field for the appId
in the absence of an identifier field. We are then able to query the IG by the appId and filter for the supported versions in the server request.
Additionally, we can use ImplementationGuide.version
field to store the version of the application that is supported by the IG. Each app version will have one IG.
The version field is also indexed by the SDK the database.
To use the useContext
ranges to search for matching Implementation guide(s) we will add prefixes to the search parameter values.
From playing around in postman, prefix ranges would serve to find the intersecting set of IGs that will in the HAPI FHIR server. e.g if we have two IGs with the following useContexts
"useContext": [
{
"valueRange": {
"low": {
"value": 10
},
"high": {
"value": 15
}
}
}
]
"useContext": [
{
"valueRange": {
"low": {
"value": 13
},
"high": {
"value": 20
}
}
}
]
The request below will bring back both resources.
{{base_url}}/ImplementationGuide?name={{appId}}&context-quantity=ge12&context-quantity=le17
while the following will return or include the IG with low value 13 and high value 20
{{base_url}}/ImplementationGuide?name={{appId}}&context-quantity=ge16&context-quantity=le25
To visualize
10 15
|--------------------|
12 17
|-------------------------|
13 20
|-------------------------|
Since the above does not pick out a single IG, we can filter using _sort
and ensure we get the top one using count like in the this example
?name={{appId}}&context-quantity=le20&_sort=-context-quantity&_count=1
Describe the feature request. In line with configs versioning issue and the subsequent discussion, add support for ImplementationGuide resource to define the configs that define an OpenSRP 2 app.
Additional context OpenSRP 2 is being updated with new features and improvements in line with project requirements and organic maturity of the platform. Updates to OpenSRP 2 may require changes to definitions in app configurations.
In line with this, there is a need to ensure compatibility between FHIR configs downloaded from the server and the version of the OpenSRP 2 app running on a device.
Acceptance criteria
definition.resource.reference
. The app should then retrieve all configs referenced to the composition resourceImplementation plan (For Engineers)
url
- globally unique URI for the implementation guideImplementationGuide/{unique-identifier}
version
- sequential version number of the configname
- computer friendly name for the IG. Have theappId
in this field and use it to retrieve the IGtitle
- Human friendly name for the IGstatus
- publication status of the IG (draft, active, retired, unknown)packageId
- package name for the IGfhirVersion
- FHIR version(s) the IG targetsuseContext.valueRange
- a range of lowest and highest supported APK versions codes. Using the version code over the SEMVER version simplifies filtering by range when fetching from the serverdefinition.resource
- a reference to the existing composition resourceDocumentation on how to set IG’s version and useContext range values
The IG
useContext
value should be a range of the app's supported version codes. Using version codes over the app's semantic version allows us to more easily filter from the server by range.useContext.valueRange.low
- the minimum supported version code. Skip this value if the support starts from the earliest versionuseContext.valueRange.high
- the maximum supported version code. Skip this value if the support starts from low and supports every version above thatSample ImplementationGuide