Closed pld closed 3 weeks ago
Somewhat related issue, https://github.com/onaio/fhir-tooling/issues/6
Somewhat related issue, https://github.com/opensrp/fhircore/issues/3113
NB. We need some form of template validation that will help validate gaps in missing references that cause malformed resources e.g.
Patient/$patient_id
= valid$patient_id
is not valid Patient/
is not validThis should apply to other Resources that reference each other
Maybe having a reference check such as Reference xx/xx should be sufficient
Good call, yep we probably need something like a linter for FHIR, or a very rudimentary version of that
@Wambere @f-odhiambo I am looking at this validation in 2 stages
cc: @pld
Sounds good, for stage 2 we would not want to access a server, we need to have this test work without assuming anything exists that the test writer cannot control.
There's a potential Stage 3 where we write the extracted resources first, or a subset of them, like should create this resources with these keys filled... hmm actually instead of writing the extracted resource a Profile might be want we want , then we validate that the extracted resources matches the target (or the profile). And later we build tooling to generate the structuremap from the Q and the target/profile
@Wambere let's focus on Stage 1 for now, get that into CI, then we can revisit the approach for Stage 2 and how it fits into our priorities.
marking as blocked by #15
Breaking this down to actionable tasks
validateStructureMap
generateResponse
command to generate QuestionnaireResponses
validateFhir
command to validate the generated QuestionnaireResponsesvalidateFhir
command to validate the output resources. Pass if all generated resources are valid, and fail if any of them are invalidcc @pld @ndegwamartin
@pld @dubdabasoduba @f-odhiambo @ndegwamartin
We are trying to map the Questionnaires and StructureMaps in the composition file and we're trying to figure out if it's possible for us to all agree on the same format to naming these resources. For example can we enforce that the title
should always match? Or the title
and the identifier.value
should always match (replacing spaces with -
or something like that)
For example:
_compositionconfig.json
[
{
"title": "Questionnaires",
"mode": "working",
"section": [
{
"title": "Add Family Member",
"focus": {
"reference": "Questionnaire/ccaedb32-0e23-4a29-8df1-bde75bf4a183",
"identifier": {
"value": "add-family-member"
}
},
"mode": "working"
}
]
},
{
"title": "StructureMaps",
"mode": "working",
"section": [
{
"title": "Add Family Member",
"focus": {
"reference": "StructureMap/eb7e8cbb-4cef-4d62-9e4d-7d4243b68c80",
"identifier": {
"value": "add-family-member"
}
},
"mode": "working"
}
]
}
]
So far it looks like every project has it's own style
@Wambere @sharon2719 I am okay with the suggested naming approach. Can we add it to the validation? So validation fails if the naming is not adhered to.
After a small discussion with @ndegwamartin we found out that this is already happening here for the validate command. This basically checks the structureMap that is referenced inside the questionnaire (so not using the composition) So @sharon2719 is looking into how we can basically use the same functionality to build the Questionnaire/StructureMap map
Extend validation tooling and expand CI to: