Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHEMEDDosage ch-dosage-1 is wrong? #263

Closed
dvribeira opened this issue Mar 18, 2024 · 6 comments · Fixed by #264
Closed

CHEMEDDosage ch-dosage-1 is wrong? #263

dvribeira opened this issue Mar 18, 2024 · 6 comments · Fixed by #264
Assignees
Labels
Dosage Dosage related issue profiling
Milestone

Comments

@dvribeira
Copy link
Contributor

During some CH EMED EPR tests we noticed some systems where sending split dose statements with base dosage without a sequence field. Having a look at this I noticed that the ch-dosage-1 constraint seems to be wrong.

What I did to test this with a local build of CH EMED EPR was to add a constraint on the document entry level, on my case to the medication statement resource for testing it:

Invariant: ch-emed-epr-dosage-1-replacement
Description: "If more than one dosage is provided (split dosage), the base dosage must have sequence = 1."
Severity: #error
Expression: "dosage.count() > 1 implies dosage.where($this.conformsTo('http://fhir.ch/ig/ch-emed-epr/StructureDefinition/ch-emed-epr-dosage') and sequence = 1).exists()"

This solution seems to be working fine.

There might be better ways of solving this, though, since I am no FhirPath expert. If you think this is ok I can do it for CH EMED and open a PR (one invariant suffices but has to be added to CHEMEDMedicationStatement, CHEMEDMedicationRequest and CHEMEDMedicationDispense) myself.

Cheers!

@dvribeira
Copy link
Contributor Author

Sorry just to clarify I'm aware the constraint I pasted does only the check for the split dose case and not the case of enforcing sequence is absent if simple dose. I just wanted to try the complex case, I would add the absent sequence check as well before doing the PR.

@dvribeira
Copy link
Contributor Author

dvribeira commented Mar 21, 2024

a full one:

Expression: "(dosage.count() > 1 implies dosage.where($this.conformsTo('http://fhir.ch/ig/ch-emed-epr/StructureDefinition/ch-emed-epr-dosage') and sequence = 1).exists()) and (dosage.count() = 1 implies dosage.single().sequence.exists().not())"

@ziegm ziegm self-assigned this Mar 21, 2024
@ziegm
Copy link
Collaborator

ziegm commented Mar 21, 2024

21.03.2024 PJ, DV, QL, MZ, AB:
adapt the constraints

ziegm added a commit that referenced this issue Mar 22, 2024
@ziegm
Copy link
Collaborator

ziegm commented Mar 22, 2024

@pjolo please review the changes.
@dvribeira please review the changes and may test it on your side.

@ziegm ziegm linked a pull request Mar 22, 2024 that will close this issue
@ziegm ziegm assigned pjolo and dvribeira and unassigned ziegm Mar 22, 2024
@dvribeira
Copy link
Contributor Author

@dvribeira they are good , thanks!! :)

@pjolo
Copy link
Collaborator

pjolo commented Mar 26, 2024

The changes are good

ziegm added a commit that referenced this issue Mar 26, 2024
add dosage sequence constraints #263
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dosage Dosage related issue profiling
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants