LHNCBC / lforms

See the project website at http://lhncbc.github.io/lforms/, or view the demo website at https://lhcforms.nlm.nih.gov/lhcforms.
Other
105 stars 56 forks source link

Questionnaire R4 population of copyright value #129

Closed adunsulag closed 1 year ago

adunsulag commented 1 year ago

I'm passing in the copyrightNotice for the lform into the LForms.Util.getFormFHIRData function for an R4 Questionnaire and I expected the copyright property of the Questionnaire resource to be populated. However, it doesn't look like that property gets populated. Is this something y'all would be interested in getting a PR for? For my use case I want to keep the copyright with the Questionnaire resource.

I can see in this method that it doesn't appear to populate the copyright values: https://github.com/lhncbc/lforms/blob/76d0118d7de51f651262936d0c899a614e3a3dff/src/fhir/sdc-export-common.js#L55

This is my function call, I've truncated the items property for brevity. Note the version of lforms I am using is 33.2 but I am retrieving the lform definition from the https://clinicaltables.nlm.nih.gov/loinc_form_definitions endpoint.

let data = {
  code: "69724-3",
  codeSystem: "http://loinc.org",
  codingInstructions: null,
  copyrightNotice: "Copyright © Pfizer Inc. All rights reserved. Developed by Drs. Robert L. Spitzer, Janet B.W. Williams, Kurt Kroenke 
  and colleagues, with an educational grant from Pfizer Inc. No permission required to reproduce, translate, display or distribute.",
  items: [],
  lformsVersion: "29.0.0",
  name:  "Patient Health Questionnaire 4 item (PHQ-4) [Reported]",
  type: "LOINC"
};
let qFhir = LForms.Util.getFormFHIRData("Questionnaire", 'R4', data);
plynchnlm commented 1 year ago

Yes, a PR would be helpful. Also, currently the import process just copies over 'copyright' instead of putting it into 'copyrightNotice'. 'copyright' should be removed from formLevelFields in sdc-import-common.js (which is a list of fields that are just copied) when this is fixed.