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

Add support for optional questionnaire items #161

Closed
wants to merge 9 commits into from

Conversation

wetret
Copy link
Member

@wetret wetret commented Jan 4, 2024

resolves #160

@wetret wetret added this to the 1.5.0 milestone Jan 4, 2024
@wetret wetret requested a review from hhund January 4, 2024 08:00
@hhund hhund linked an issue Jan 11, 2024 that may be closed by this pull request
@wetret wetret self-assigned this Jan 12, 2024
else
return null;
const url = window.location.pathname
const regex = new RegExp('(?:(?:[A-Za-z0-9\-\\\.\:\%\$]*\/)+)?'

Check failure

Code scanning / CodeQL

Useless regular-expression character escape High

The escape sequence '-' is equivalent to just '-', so the sequence may still represent a meta-character when it is used in a
regular expression
.
else
return null;
const url = window.location.pathname
const regex = new RegExp('(?:(?:[A-Za-z0-9\-\\\.\:\%\$]*\/)+)?'

Check failure

Code scanning / CodeQL

Useless regular-expression character escape High

The escape sequence '$' is equivalent to just '$', so the sequence may still represent a meta-character when it is used in a
regular expression
.
const url = window.location.pathname
const regex = new RegExp('(?:(?:[A-Za-z0-9\-\\\.\:\%\$]*\/)+)?'
+ '(Account|ActivityDefinition|AdverseEvent|AllergyIntolerance|Appointment|AppointmentResponse|AuditEvent|Basic|Binary|BiologicallyDerivedProduct|BodyStructure|Bundle|CapabilityStatement|CarePlan|CareTeam|CatalogEntry|ChargeItem|ChargeItemDefinition|Claim|ClaimResponse|ClinicalImpression|CodeSystem|Communication|CommunicationRequest|CompartmentDefinition|Composition|ConceptMap|Condition|Consent|Contract|Coverage|CoverageEligibilityRequest|CoverageEligibilityResponse|DetectedIssue|Device|DeviceDefinition|DeviceMetric|DeviceRequest|DeviceUseStatement|DiagnosticReport|DocumentManifest|DocumentReference|EffectEvidenceSynthesis|Encounter|Endpoint|EnrollmentRequest|EnrollmentResponse|EpisodeOfCare|EventDefinition|Evidence|EvidenceVariable|ExampleScenario|ExplanationOfBenefit|FamilyMemberHistory|Flag|Goal|GraphDefinition|Group|GuidanceResponse|HealthcareService|ImagingStudy|Immunization|ImmunizationEvaluation|ImmunizationRecommendation|ImplementationGuide|InsurancePlan|Invoice|Library|Linkage|List|Location|Measure|MeasureReport|Media|Medication|MedicationAdministration|MedicationDispense|MedicationKnowledge|MedicationRequest|MedicationStatement|MedicinalProduct|MedicinalProductAuthorization|MedicinalProductContraindication|MedicinalProductIndication|MedicinalProductIngredient|MedicinalProductInteraction|MedicinalProductManufactured|MedicinalProductPackaged|MedicinalProductPharmaceutical|MedicinalProductUndesirableEffect|MessageDefinition|MessageHeader|MolecularSequence|NamingSystem|NutritionOrder|Observation|ObservationDefinition|OperationDefinition|OperationOutcome|Organization|OrganizationAffiliation|Patient|PaymentNotice|PaymentReconciliation|Person|PlanDefinition|Practitioner|PractitionerRole|Procedure|Provenance|Questionnaire|QuestionnaireResponse|RelatedPerson|RequestGroup|ResearchDefinition|ResearchElementDefinition|ResearchStudy|ResearchSubject|RiskAssessment|RiskEvidenceSynthesis|Schedule|SearchParameter|ServiceRequest|Slot|Specimen|SpecimenDefinition|StructureDefinition|StructureMap|Subscription|Substance|SubstanceNucleicAcid|SubstancePolymer|SubstanceProtein|SubstanceReferenceInformation|SubstanceSourceMaterial|SubstanceSpecification|SupplyDelivery|SupplyRequest|Task|TerminologyCapabilities|TestReport|TestScript|ValueSet|VerificationResult|VisionPrescription)'
+ '(?:(?:\/([A-Za-z0-9\-\.]{1,64}))?(?:\/(_history)(?:\/([0-9]{1,64}))?)?)?(?:\\?.*)?$')

Check failure

Code scanning / CodeQL

Useless regular-expression character escape High

The escape sequence '.' is equivalent to just '.', so the sequence may still represent a meta-character when it is used in a
regular expression
.
const url = window.location.pathname
const regex = new RegExp('(?:(?:[A-Za-z0-9\-\\\.\:\%\$]*\/)+)?'
+ '(Account|ActivityDefinition|AdverseEvent|AllergyIntolerance|Appointment|AppointmentResponse|AuditEvent|Basic|Binary|BiologicallyDerivedProduct|BodyStructure|Bundle|CapabilityStatement|CarePlan|CareTeam|CatalogEntry|ChargeItem|ChargeItemDefinition|Claim|ClaimResponse|ClinicalImpression|CodeSystem|Communication|CommunicationRequest|CompartmentDefinition|Composition|ConceptMap|Condition|Consent|Contract|Coverage|CoverageEligibilityRequest|CoverageEligibilityResponse|DetectedIssue|Device|DeviceDefinition|DeviceMetric|DeviceRequest|DeviceUseStatement|DiagnosticReport|DocumentManifest|DocumentReference|EffectEvidenceSynthesis|Encounter|Endpoint|EnrollmentRequest|EnrollmentResponse|EpisodeOfCare|EventDefinition|Evidence|EvidenceVariable|ExampleScenario|ExplanationOfBenefit|FamilyMemberHistory|Flag|Goal|GraphDefinition|Group|GuidanceResponse|HealthcareService|ImagingStudy|Immunization|ImmunizationEvaluation|ImmunizationRecommendation|ImplementationGuide|InsurancePlan|Invoice|Library|Linkage|List|Location|Measure|MeasureReport|Media|Medication|MedicationAdministration|MedicationDispense|MedicationKnowledge|MedicationRequest|MedicationStatement|MedicinalProduct|MedicinalProductAuthorization|MedicinalProductContraindication|MedicinalProductIndication|MedicinalProductIngredient|MedicinalProductInteraction|MedicinalProductManufactured|MedicinalProductPackaged|MedicinalProductPharmaceutical|MedicinalProductUndesirableEffect|MessageDefinition|MessageHeader|MolecularSequence|NamingSystem|NutritionOrder|Observation|ObservationDefinition|OperationDefinition|OperationOutcome|Organization|OrganizationAffiliation|Patient|PaymentNotice|PaymentReconciliation|Person|PlanDefinition|Practitioner|PractitionerRole|Procedure|Provenance|Questionnaire|QuestionnaireResponse|RelatedPerson|RequestGroup|ResearchDefinition|ResearchElementDefinition|ResearchStudy|ResearchSubject|RiskAssessment|RiskEvidenceSynthesis|Schedule|SearchParameter|ServiceRequest|Slot|Specimen|SpecimenDefinition|StructureDefinition|StructureMap|Subscription|Substance|SubstanceNucleicAcid|SubstancePolymer|SubstanceProtein|SubstanceReferenceInformation|SubstanceSourceMaterial|SubstanceSpecification|SupplyDelivery|SupplyRequest|Task|TerminologyCapabilities|TestReport|TestScript|ValueSet|VerificationResult|VisionPrescription)'
+ '(?:(?:\/([A-Za-z0-9\-\.]{1,64}))?(?:\/(_history)(?:\/([0-9]{1,64}))?)?)?(?:\\?.*)?$')

Check failure

Code scanning / CodeQL

Useless regular-expression character escape High

The escape sequence '-' is equivalent to just '-', so the sequence may still represent a meta-character when it is used in a
regular expression
.
bookmarks[resourceType] = resourceTypeBookmarks.sort();
const resourceTypeBookmarks = bookmarks[resourceType] !== undefined ? bookmarks[resourceType] : []
resourceTypeBookmarks.push(url)
bookmarks[resourceType] = resourceTypeBookmarks.sort()

Check failure

Code scanning / CodeQL

Remote property injection High

A property name to write to depends on a
user-provided value
.
const urlVersion = profile.split('|')

if (urlVersion.length > 1) {
const url = urlVersion[0]

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable url.
}

window.addEventListener('DOMContentLoaded', () => {
setUiTheme()
prettyPrint()
checkBookmarked()
openInitialTab()
adaptTaskFormInputs()

const resourceType = getResourceTypeForCurrentUrl()

Check failure

Code scanning / CodeQL

Assignment to constant Error

Assignment to variable resourceType, which is
declared
constant.
@@ -42,10 +45,9 @@
document.querySelector('div.tab > button#json-button')?.addEventListener('click', () => openTab('json'))
document.querySelector('div.tab > button#xml-button')?.addEventListener('click', () => openTab('xml'))

const resourceType = getResourceTypeForCurrentUrl();
const resourceType = getResourceTypeForCurrentUrl()

Check failure

Code scanning / CodeQL

Assignment to constant Error

Assignment to variable resourceType, which is
declared
constant.

for (let i = 0; i < searchParam.length; i++) {
for (let i = 0 i < searchParam.length i++) {

Check notice

Code scanning / CodeQL

Syntax error Note

Error: Unexpected token
for (let i = 0; i < tabcontent.length; i++)
tabcontent[i].style.display = "none"
const tabcontent = document.getElementsByClassName("prettyprint")
for (let i = 0 i < tabcontent.length i++)

Check notice

Code scanning / CodeQL

Syntax error Note

Error: Unexpected token
@hhund
Copy link
Member

hhund commented Feb 13, 2024

changes for #160 will be merged via PR #176

@hhund hhund closed this Feb 13, 2024
@hhund hhund deleted the issues/160_optional-questionnaire-items branch February 22, 2024 15:03
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.

Allow Optional Elements in Questionnaire
2 participants