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

Ch emed epr/emediplan #187

Merged
merged 30 commits into from
Oct 25, 2024
Merged

Ch emed epr/emediplan #187

merged 30 commits into from
Oct 25, 2024

Conversation

dvribeira
Copy link
Collaborator

This PR addresses the changes needed to implement the new feature requested with #181 .

This work includes:

  • New dependencies on the main pom (zxing to generate QR codes and openhtmltopdf to generate PDFs)
  • A model for eMediplan objects including validation (at a model level). Some minor modifications of existing CH EMED EPR FHIR classes were done as well to enable/ease the conversion from CH EMED EPR to eMediplan.
  • The emed-ch-epr-narrative module PDF generation has been reworked a bit and supports now also eMediplan PDF generation. To this avail, an eMediplan narrative generation has also been added to the module.
  • In the communication-ch module, a new custom parameter has been added to the ChFindMedicationCardQuery to specify which paper format should be used for the medication card.

What has not been done/tested and is left for future development:

  • The model has been used for serialization but it has not been used for parsing yet. That might require more coding on the model to fully support parsing.
  • Prescription generation, though foreseen, has not been coded yet. The eMediplan model is coded, but not the conversion from a CH EMED EPR prescription.
  • emediplan_medications_table.html in husky-fhir-emed-ch-epr-narrative has a few TODO comments. These will be addressed once the ChMed23A paper specification is released (AFAIK this is a current WIP and should be released before the end of this year) and a review of the layout in husky is performed to ensure it is compliant.

dvribeira and others added 25 commits July 31, 2024 16:28
…h copying changed medication statements between different subtypes of observations (e.g. when copying a PADV observation to a PML).
@dvribeira dvribeira requested a review from qligier October 3, 2024 09:41
@dvribeira dvribeira linked an issue Oct 3, 2024 that may be closed by this pull request
@dvribeira
Copy link
Collaborator Author

dvribeira commented Oct 3, 2024

@qligier IIRC you also use emed-ch-epr-narrative for the prescription PDF generation for the CARA portal, it might be that this PR would break a bit your code and some changes might be needed on the portal side.

@qligier
Copy link
Member

qligier commented Oct 3, 2024

@qligier IIRC you also use emed-ch-epr-narrative for the prescription PDF generation for the CARA portal, it might be that this PR would break a bit your code and some changes might be needed on the portal side.

Indeed, I'll check that. Thanks!

These will be addressed once the ChMed23A paper specification is released (AFAIK this is a current WIP and should be released before the end of this year)

It is already released: https://emediplan.ch/vorstand-genehmigt-chmed23a/

@dvribeira
Copy link
Collaborator Author

dvribeira commented Oct 3, 2024

It is already released: https://emediplan.ch/vorstand-genehmigt-chmed23a/

The JSON specification is out, the paper/print layout specification - which they decided to publish separately for ChMed23A - is not out yet. We'll have to wait a tad bit more.

"nmol",
"nmol",
"nmol",
"nmol"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I failed to update this enum while updating the value sets. From c029d01#diff-41404c6413bed2afac45c3d235788fb6917739dac0a8b5051cf9f106c92134a5, it seems we are also missing APPLICATION_UNIT_OF_PRODUCT_USAGE_QUALIFIER_VALUE (413568008) here.

Copy link
Collaborator Author

@dvribeira dvribeira Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact those are too new for the currently published version of the CH EMED EPR value set... I will remove NMOL from this PR and from the CdTyp9 conversion and will have to be added back with the next version of CH EMED EPR based on CH EMED 5.0.0. The enum units affected will be:

private static final Pattern LANGUAGE_CODE_PATTERN = Pattern.compile("[a-zA-Z]{2}" );
private static final Pattern PHONE_NUMBER_PATTERN = Pattern.compile("\\+?[0-9]+[ 0-9]*");
private static final Pattern EMAIL_PATTERN =
Pattern.compile("^(?=.{1,64}@)[\\\\p{L}0-9_-]+(\\\\.[\\\\p{L}0-9_-]+)*@[^-][\\\\p{L}0-9-]+(\\\\.[\\\\p{L}0-9-]+)*(\\\\.[\\\\p{L}]{2,})$");

Check failure

Code scanning / CodeQL

Inefficient regular expression High

This part of the regular expression may cause exponential backtracking on strings starting with '-\a' and containing many repetitions of '--'.
private static final Pattern LANGUAGE_CODE_PATTERN = Pattern.compile("[a-zA-Z]{2}" );
private static final Pattern PHONE_NUMBER_PATTERN = Pattern.compile("\\+?[0-9]+[ 0-9]*");
private static final Pattern EMAIL_PATTERN =
Pattern.compile("^(?=.{1,64}@)[\\\\p{L}0-9_-]+(\\\\.[\\\\p{L}0-9_-]+)*@[^-][\\\\p{L}0-9-]+(\\\\.[\\\\p{L}0-9-]+)*(\\\\.[\\\\p{L}]{2,})$");

Check failure

Code scanning / CodeQL

Inefficient regular expression High

This part of the regular expression may cause exponential backtracking on strings starting with '-@,-\a' and containing many repetitions of '--'.
…nd implementors about expected context variables
…der#usePdfUaAccessbility, deprecated, with the typo-free usePdfUaAccessibility
…p9#fromRegularUnitCodeAmbu since not yet in current published version fo the CH EMED EPR value set. Will be added back with the next version of CH EMED EPR.
@dvribeira dvribeira requested a review from qligier October 16, 2024 16:36
@ralych ralych merged commit 74c6e66 into develop Oct 25, 2024
2 of 3 checks passed
@ralych ralych deleted the ch-emed-epr/emediplan branch October 25, 2024 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CH EMED EPR: add support for eMediplan PDF generation
3 participants