profile
viewpoint

HL7/fhir-shc-vaccination-ig 25

FHIR Implementation Guide describing clinical and patient data contained within a SMART Health Card

standardhealth/smart-react-app-template 14

Template to get a SMART on FHIR-based React app started quickly

synthetichealth/fhir-visualizers 8

Simple React-based FHIR Visualizers

radamson/AHRQ-CDS-Connect-Authoring-Tool 0

The CDS Authoring Tool is part of the CDS Connect project https://cds.ahrq.gov/, sponsored by the Agency for Healthcare Research and Quality (AHRQ), and developed under contract with AHRQ by MITRE's CAMH FFRDC.

Pull request review commentdvci/shc-web-verifier

Validator

 Instead, it will copy all the configuration files and the transitive dependencie  You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. +## Client-side CDC CDSi validator app++Limited scope, CQL engine based client-side validation app that executes the CDSi supporting data guidelines.++Currently only validates each non-Risk type series based on dose absMinAge, allowable vaccine codes (CVX only), and allowableInterval absMinInt fromPrevious.++Does not support forecasting or any other validation, including conditional doses, recurring or seasonal doses, immunity or contradictions.++### Update CQL library++Script to convert CQL to ELM and write results to src/output-elm.++`yarn translate`

oh cool I didn't realize that. I tried running locally, but must not have had Docker running.

nkarip

comment created time in 17 hours

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentdvci/shc-web-verifier

Validator

 Instead, it will copy all the configuration files and the transitive dependencie  You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. +## Client-side CDC CDSi validator app++Limited scope, CQL engine based client-side validation app that executes the CDSi supporting data guidelines.++Currently only validates each non-Risk type series based on dose absMinAge, allowable vaccine codes (CVX only), and allowableInterval absMinInt fromPrevious.++Does not support forecasting or any other validation, including conditional doses, recurring or seasonal doses, immunity or contradictions.++### Update CQL library++Script to convert CQL to ELM and write results to src/output-elm.++`yarn translate`

Since this requires the CQL translation service to be running on localhost it would be nice to have some mention of that here and instructions so that others can successfully run it.

nkarip

comment created time in 6 days

PullRequestReviewEvent

Pull request review commentdvci/shc-web-verifier

Validator

     "predeploy": "yarn run build",     "deploy": "gh-pages -d build",     "lint": "eslint './src/**/*.{js,jsx}'",-    "lint:fix": "eslint './src/**/*.{js,jsx}' --fix"+    "lint:fix": "eslint './src/**/*.{js,jsx}' --fix",
    "lint:fix": "eslint './src/**/*.{js,jsx,ts,tsx}' --fix",

Updating file extensions so .ts and .tsx files are corrected with yarn lint:fix

nkarip

comment created time in 6 days

PullRequestReviewEvent

Pull request review commentdvci/shc-web-verifier

Validator

     "predeploy": "yarn run build",     "deploy": "gh-pages -d build",     "lint": "eslint './src/**/*.{js,jsx}'",
    "lint": "eslint './src/**/*.{js,jsx,ts,tsx}'",

Updating file extensions so .ts and .tsx files are checked with yarn lint

nkarip

comment created time in 6 days

Pull request review commentdvci/shc-web-verifier

Validator

 {   "extends": [     "react-app",+    "react-app/jest",     "airbnb",     "plugin:jsx-a11y/recommended"   ],+  "overrides": [+    {+      "files": ["*.ts", "*.tsx"],+      "extends": ["airbnb", "airbnb-typescript", "prettier"],+      "plugins": ["prettier"],+      "parser": "@typescript-eslint/parser"+    }+  ],
    "react-app/jest",
    "airbnb",
    "airbnb-typescript",
    "prettier",
    "plugin:jsx-a11y/recommended"
  ],

I've used prettier and eslint:recommended before, but never airbnb (although I appreciate their thorough style guide!)

I'm up for using it if others are (@danlee1025, thoughts?). Instead of overriding and applying just to the TypeScript files, it would be nice to use it across both the JS and TS files.

We should remove some of our existing overrides at this point and only add them back after conciously considering it:

e.g. comma-dangle is turned off on line 23, but the airbnb style guide requires it. (GitHub won't let me comment on those lines directly).

It might be better to remove some of the rule overrides in a separate PR.

nkarip

comment created time in 6 days

push eventinferno-framework/inferno-core

Reece Adamson

commit sha 3f46367c8268a01dd7db9f4c6072607b27241776

Update lib/inferno/test_runner.rb Co-authored-by: Stephen MacVicar <Jammjammjamm@users.noreply.github.com>

view details

push time in 7 days

push eventinferno-framework/inferno-core

Reece Adamson

commit sha ea20ca1cc51ab2a44677248f71a35c199b460579

Update lib/inferno/entities/has_runnable.rb Co-authored-by: Stephen MacVicar <Jammjammjamm@users.noreply.github.com>

view details

push time in 7 days

Pull request review commentinferno-framework/inferno-core

(WIP) FI-1357 Allow Tests and Groups to Be Marked as Optional

 def self.extended(extending_class)             end           end         end+        @optional = false

This was to force optional to be a boolean, so that the api would return:

"optional": false instead of "optional": null.

Fixed by using !! in optional? in https://github.com/inferno-framework/inferno-core/pull/52/commits/d67e3486edbd323149d9bce3967dcdd795596a6d

radamson

comment created time in 7 days

PullRequestReviewEvent

push eventinferno-framework/inferno-core

Reece Adamson

commit sha d67e3486edbd323149d9bce3967dcdd795596a6d

force `optional?` to be boolean

view details

push time in 7 days

push eventinferno-framework/inferno-core

Alyssa Wang

commit sha ebf6b4e72952432fb8da27dc6f87042ccfc17f59

Navigation drawer (#53) * replace header with appbar * remove overscroll bounce * convert tree view to drawer * update lint rules for appbar Co-authored-by: Alyssa Wang <awang@mitre.org>

view details

Alyssa Wang

commit sha d5b55a11f2d529c5c97f138f20bf53b374612718

FI-1360 Logo bug fix (#54) * update selection colors * fix background color, add custom tree item * remove icon color * simplify layout * simplify button styling * remove spacer * fix logo bug Co-authored-by: Alyssa Wang <awang@mitre.org>

view details

Reece Adamson

commit sha 42050c9da5dae52ac713b190294b947b1fcf19ad

add optional to dev_suites

view details

Reece Adamson

commit sha 64602532c326f81021006196651d7c82508a09aa

update inferno dsl

view details

Reece Adamson

commit sha 0be67067f87d74641cc0878bd8323de402fa162b

update web serializers

view details

Reece Adamson

commit sha 4838afd8dce325700dc5bc001ebb9c24563dbaed

add has_runnable and update results roll up

view details

Reece Adamson

commit sha 4814c12df1cb7d367fb68f087a3868e8d1217943

make runnables @optional false by default. Otherwise they default to nil and the web serialization turns that to null in the json

view details

Reece Adamson

commit sha 16214859648d921d7e4ceb1722a48749b1cdd00b

lighter color for failing optional tests

view details

Reece Adamson

commit sha 676ddd738ee9108f5cfe9b2c16fa75f3762cb42d

fix how defaulting to required is done so that it is not overwritten when using externally sourced group

view details

Reece Adamson

commit sha 3d556ccec0bfe9218c25d901ec8bca1fac607c2b

add indication for Optional Groups

view details

Reece Adamson

commit sha c6481f80be0240a73bf516664331e4e437ce118d

indicate optional tests in ui

view details

Reece Adamson

commit sha 69ee733f6a50e8f39c0316f8095b7a9fe93e57ed

linting

view details

Reece Adamson

commit sha b46148841b6c10d468c4217520e7c7df621fdb8a

rubocop

view details

Reece Adamson

commit sha 8e144f9b9141c94482e34219648c302199306cd1

fix tests

view details

push time in 7 days

Pull request review commentdvci/health_cards

Health Cards API Redesign

 require 'health_cards/private_key' require 'health_cards/public_key' require 'health_cards/health_card'+require 'health_cards/payload' require 'health_cards/attribute_filters'-require 'health_cards/card_types'+require 'health_cards/payload_types' require 'health_cards/chunking_utils' require 'health_cards/errors' require 'health_cards/qr_codes' require 'health_cards/chunk' require 'health_cards/verifier' require 'health_cards/importer'-require 'health_cards/covid_health_card'-require 'health_cards/covid_immunization_card'-require 'health_cards/covid_lab_result_card'+require 'health_cards/covid_payload'+require 'health_cards/covid_immunization_payload'+require 'health_cards/covid_lab_result_payload'

Should we have a payload_types subdirectory so that we can just import health_cards/payload_types? We have a decent amount of library files so it might be a good time to start grouping files together.

ssayer

comment created time in 7 days

Pull request review commentdvci/health_cards

Health Cards API Redesign

 jws = 'foofoofoo.barbarbar.bazbazbaz'  # By default the verifier will search for and resolve public keys to verify credentials verifier.verify(jws)+ ``` -## Manually Operation+## Creating/Using a Health Card -Most applications will want to use the library from `Issuer` or `Verifier`.-Health Cards can also be manually created and verified if more control is needed.+HealthCards encapsulate a JWS in order to faciliate the use of the data by systems
HealthCards encapsulate a data in a JWS in order to faciliate the use of the data by systems
ssayer

comment created time in 7 days

Pull request review commentdvci/health_cards

Health Cards API Redesign

 # frozen_string_literal: true -require 'zlib'-require 'uri'--require 'health_cards/attribute_filters'-require 'health_cards/card_types'- module HealthCards-  # A HealthCard which implements the credential claims specified by https://smarthealth.cards/+  # Represents a signed SMART Health Card   class HealthCard-    include HealthCards::AttributeFilters-    extend HealthCards::CardTypes--    FHIR_REF_REGEX = %r{((http|https)://([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/[A-Za-z0-9\-.]{1,64})?}x.freeze--    attr_reader :issuer, :nbf, :bundle--    class << self-      # Creates a HealthCard from a JWS-      # @param jws [String] the JWS string-      # @param public_key [HealthCards::PublicKey] the public key associated with the JWS-      # @param key [HealthCards::PrivateKey] the private key associated with the JWS-      # @return [HealthCards::HealthCard]-      def from_jws(jws, public_key: nil, key: nil)-        jws = JWS.from_jws(jws, public_key: public_key, key: key)-        from_payload(jws.payload)-      end--      # Create a HealthCard from a compressed payload-      # @param payload [String]-      # @return [HealthCards::HealthCard]-      def from_payload(payload)-        json = decompress_payload(payload)-        bundle_hash = json.dig('vc', 'credentialSubject', 'fhirBundle')--        raise HealthCards::InvalidCredentialError unless bundle_hash+    extend Forwardable -        bundle = FHIR::Bundle.new(bundle_hash)-        new(issuer: json['iss'], bundle: bundle)-      end--      # Decompress an arbitrary payload, useful for debugging-      # @param payload [String] compressed payload-      # @return [Hash] Hash built from JSON contents of payload-      def decompress_payload(payload)-        inf = Zlib::Inflate.new(-Zlib::MAX_WBITS).inflate(payload)-        JSON.parse(inf)-      end+    attr_reader :jws -      # Compress an arbitrary payload, useful for debugging-      # @param payload [Object] Any object that responds to to_s-      # @return A compressed version of that payload parameter-      def compress_payload(payload)-        Zlib::Deflate.new(nil, -Zlib::MAX_WBITS).deflate(payload.to_s, Zlib::FINISH)-      end+    def_delegator :@jws, :verify+    def_delegator :@qr_codes, :code_by_ordinal+    def_delegators :@payload, :bundle, :issuer -      # Sets/Gets the fhir version that will be passed through to the credential created by an instnace of-      # this HealthCard (sub)class-      # @param ver [String] FHIR Version supported by this HealthCard (sub)class. Leaving this param out-      # will only return the current value-      # value (used as a getter)-      # @return [String] Current FHIR version supported-      def fhir_version(ver = nil)-        if @fhir_version.nil? && ver.nil?-          @fhir_version = superclass.fhir_version unless self == HealthCards::HealthCard-        elsif ver-          @fhir_version = ver-        end-        @fhir_version-      end+    def initialize(jws)+      @jws = jws.is_a?(String) ? JWS.from_jws(jws) : jws+      @payload = Payload.from_payload(@jws.payload)+      @qr_codes = QRCodes.from_jws(@jws)     end -    fhir_version '4.0.1'--    additional_types 'https://smarthealth.cards#health-card'--    allow type: FHIR::Meta, attributes: %w[security]--    disallow attributes: %w[id text]-    disallow type: FHIR::CodeableConcept, attributes: %w[text]-    disallow type: FHIR::Coding, attributes: %w[display]--    # Create a HealthCard-    #-    # @param bundle [FHIR::Bundle] VerifiableCredential containing a fhir bundle-    # @param issuer [String] The url from the Issuer of the HealthCard-    def initialize(bundle:, issuer: nil)-      raise InvalidPayloadError unless bundle.is_a?(FHIR::Bundle) # && bundle.valid?--      @issuer = issuer-      @bundle = bundle+    def credential+      { verifiableCredential: [@jws.to_s] }     end -    # A Hash matching the VC structure specified by https://smarthealth.cards/#health-cards-are-encoded-as-compact-serialization-json-web-signatures-jws-    # @param filter [Boolean] specifies whether the bundle should apply allow/disallow rules-    #  and meta filtering features. Defaults to true.-    # @return [Hash]-    def to_hash(filter: true)-      fhir_bundle = filter ? strip_fhir_bundle : bundle-      {-        iss: issuer,-        nbf: Time.now.to_i,-        vc: {-          type: self.class.types,-          credentialSubject: {-            fhirVersion: self.class.fhir_version,-            fhirBundle: fhir_bundle.to_hash-          }-        }-      }+    def to_json(*_args)+      credential.to_json

If we change credential we'll need to update the name here too (and in other places)

ssayer

comment created time in 7 days

Pull request review commentdvci/health_cards

Health Cards API Redesign

 # frozen_string_literal: true -require 'zlib'-require 'uri'--require 'health_cards/attribute_filters'-require 'health_cards/card_types'- module HealthCards-  # A HealthCard which implements the credential claims specified by https://smarthealth.cards/+  # Represents a signed SMART Health Card   class HealthCard-    include HealthCards::AttributeFilters-    extend HealthCards::CardTypes--    FHIR_REF_REGEX = %r{((http|https)://([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/[A-Za-z0-9\-.]{1,64})?}x.freeze--    attr_reader :issuer, :nbf, :bundle--    class << self-      # Creates a HealthCard from a JWS-      # @param jws [String] the JWS string-      # @param public_key [HealthCards::PublicKey] the public key associated with the JWS-      # @param key [HealthCards::PrivateKey] the private key associated with the JWS-      # @return [HealthCards::HealthCard]-      def from_jws(jws, public_key: nil, key: nil)-        jws = JWS.from_jws(jws, public_key: public_key, key: key)-        from_payload(jws.payload)-      end--      # Create a HealthCard from a compressed payload-      # @param payload [String]-      # @return [HealthCards::HealthCard]-      def from_payload(payload)-        json = decompress_payload(payload)-        bundle_hash = json.dig('vc', 'credentialSubject', 'fhirBundle')--        raise HealthCards::InvalidCredentialError unless bundle_hash+    extend Forwardable -        bundle = FHIR::Bundle.new(bundle_hash)-        new(issuer: json['iss'], bundle: bundle)-      end--      # Decompress an arbitrary payload, useful for debugging-      # @param payload [String] compressed payload-      # @return [Hash] Hash built from JSON contents of payload-      def decompress_payload(payload)-        inf = Zlib::Inflate.new(-Zlib::MAX_WBITS).inflate(payload)-        JSON.parse(inf)-      end+    attr_reader :jws -      # Compress an arbitrary payload, useful for debugging-      # @param payload [Object] Any object that responds to to_s-      # @return A compressed version of that payload parameter-      def compress_payload(payload)-        Zlib::Deflate.new(nil, -Zlib::MAX_WBITS).deflate(payload.to_s, Zlib::FINISH)-      end+    def_delegator :@jws, :verify+    def_delegator :@qr_codes, :code_by_ordinal+    def_delegators :@payload, :bundle, :issuer -      # Sets/Gets the fhir version that will be passed through to the credential created by an instnace of-      # this HealthCard (sub)class-      # @param ver [String] FHIR Version supported by this HealthCard (sub)class. Leaving this param out-      # will only return the current value-      # value (used as a getter)-      # @return [String] Current FHIR version supported-      def fhir_version(ver = nil)-        if @fhir_version.nil? && ver.nil?-          @fhir_version = superclass.fhir_version unless self == HealthCards::HealthCard-        elsif ver-          @fhir_version = ver-        end-        @fhir_version-      end+    def initialize(jws)+      @jws = jws.is_a?(String) ? JWS.from_jws(jws) : jws+      @payload = Payload.from_payload(@jws.payload)+      @qr_codes = QRCodes.from_jws(@jws)     end -    fhir_version '4.0.1'--    additional_types 'https://smarthealth.cards#health-card'--    allow type: FHIR::Meta, attributes: %w[security]--    disallow attributes: %w[id text]-    disallow type: FHIR::CodeableConcept, attributes: %w[text]-    disallow type: FHIR::Coding, attributes: %w[display]--    # Create a HealthCard-    #-    # @param bundle [FHIR::Bundle] VerifiableCredential containing a fhir bundle-    # @param issuer [String] The url from the Issuer of the HealthCard-    def initialize(bundle:, issuer: nil)-      raise InvalidPayloadError unless bundle.is_a?(FHIR::Bundle) # && bundle.valid?--      @issuer = issuer-      @bundle = bundle+    def credential+      { verifiableCredential: [@jws.to_s] }
    def download
      Exporter.download(@jws)

This is already implemented in Exporter where it is called download since it's actually the File Download Format.

We should be consistent with the naming. I don't really like the download name either though so I'm up for suggestions (file_download_json?)

ssayer

comment created time in 7 days

Pull request review commentdvci/health_cards

Health Cards API Redesign

 jws.public_key = public_key  # JWS will verify using the included public_key jws.verify++health_card = HealthCards::HealthCard.new(jws)+health_card.verify

Does this method actually work? Verifying requires a public key which Verifier's have, but HealthCards themselves don't.

We'd at least need to have verify accept a key or keyset if we wanted to keep this functionality.

ssayer

comment created time in 7 days

Pull request review commentdvci/health_cards

Health Cards API Redesign

 # frozen_string_literal: true -require 'zlib'-require 'uri'--require 'health_cards/attribute_filters'-require 'health_cards/card_types'- module HealthCards-  # A HealthCard which implements the credential claims specified by https://smarthealth.cards/+  # Represents a signed SMART Health Card   class HealthCard-    include HealthCards::AttributeFilters-    extend HealthCards::CardTypes--    FHIR_REF_REGEX = %r{((http|https)://([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/[A-Za-z0-9\-.]{1,64})?}x.freeze--    attr_reader :issuer, :nbf, :bundle--    class << self-      # Creates a HealthCard from a JWS-      # @param jws [String] the JWS string-      # @param public_key [HealthCards::PublicKey] the public key associated with the JWS-      # @param key [HealthCards::PrivateKey] the private key associated with the JWS-      # @return [HealthCards::HealthCard]-      def from_jws(jws, public_key: nil, key: nil)-        jws = JWS.from_jws(jws, public_key: public_key, key: key)-        from_payload(jws.payload)-      end--      # Create a HealthCard from a compressed payload-      # @param payload [String]-      # @return [HealthCards::HealthCard]-      def from_payload(payload)-        json = decompress_payload(payload)-        bundle_hash = json.dig('vc', 'credentialSubject', 'fhirBundle')--        raise HealthCards::InvalidCredentialError unless bundle_hash+    extend Forwardable -        bundle = FHIR::Bundle.new(bundle_hash)-        new(issuer: json['iss'], bundle: bundle)-      end--      # Decompress an arbitrary payload, useful for debugging-      # @param payload [String] compressed payload-      # @return [Hash] Hash built from JSON contents of payload-      def decompress_payload(payload)-        inf = Zlib::Inflate.new(-Zlib::MAX_WBITS).inflate(payload)-        JSON.parse(inf)-      end+    attr_reader :jws -      # Compress an arbitrary payload, useful for debugging-      # @param payload [Object] Any object that responds to to_s-      # @return A compressed version of that payload parameter-      def compress_payload(payload)-        Zlib::Deflate.new(nil, -Zlib::MAX_WBITS).deflate(payload.to_s, Zlib::FINISH)-      end+    def_delegator :@jws, :verify+    def_delegator :@qr_codes, :code_by_ordinal+    def_delegators :@payload, :bundle, :issuer -      # Sets/Gets the fhir version that will be passed through to the credential created by an instnace of-      # this HealthCard (sub)class-      # @param ver [String] FHIR Version supported by this HealthCard (sub)class. Leaving this param out-      # will only return the current value-      # value (used as a getter)-      # @return [String] Current FHIR version supported-      def fhir_version(ver = nil)-        if @fhir_version.nil? && ver.nil?-          @fhir_version = superclass.fhir_version unless self == HealthCards::HealthCard-        elsif ver-          @fhir_version = ver-        end-        @fhir_version-      end+    def initialize(jws)+      @jws = jws.is_a?(String) ? JWS.from_jws(jws) : jws
      @jws = JWS.from_jws(jws)

JWS.from_jws gracefully handles the JWS type (String, HealthCards::JWS, etc.).

ssayer

comment created time in 7 days

PullRequestReviewEvent

Pull request review commentdvci/health_cards

Health Cards API Redesign

 _Note: This changelog is tracking changes related to the `health_cards` library. - Updated Bundle minification to use `each_element` [\#75](https://github.com/dvci/health_cards/pull/75) - Updated README [\#70](https://github.com/dvci/health_cards/pull/70) - Removed `json-minify` dependency [\#69](https://github.com/dvci/health_cards/pull/69)-- Fixed `COVIDHealthCard` VC Type [\#56](https://github.com/dvci/health_cards/pull/56)+- Fixed `COVIDPayload` VC Type [\#56](https://github.com/dvci/health_cards/pull/56)

Should we be changing release notes from a prior release? This will still be COVIDHealthCard in v0.0.2 on RubyGems.

ssayer

comment created time in 7 days

PullRequestReviewEvent

pull request commentdvci/shc-web-verifier

Scanning for multiple QR codes.

For a future PR we should see if we can remove the setScannedCode local state in QRScan.js and just use setQrCodes. Talked with Dan about this and previously we needed the local state since before we had routing it would go to the display page immediately when the qrcodes was set.

danlee1025

comment created time in 7 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentdvci/shc-web-verifier

Scanning for multiple QR codes.

   "rules": {     "comma-dangle": "off",     "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],+    "react/no-array-index-key": "off",

I'd prefer to turn this rule off just in the offending line rather than across the whole app.

Could we avoid turning this rule off at all by using the actual chunkindex instead of the array index?

danlee1025

comment created time in 7 days

PullRequestReviewEvent
more