@imranq2/fhirpatientsummary 1.0.10 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -518,22 +518,6 @@ type TPatient = {
518
518
  link?: TPatientLink[];
519
519
  };
520
520
 
521
- type TCompositionSection = {
522
- id?: string;
523
- extension?: TExtension[];
524
- modifierExtension?: TExtension[];
525
- title?: string;
526
- code?: TCodeableConcept;
527
- author?: TReference[];
528
- focus?: TReference;
529
- text?: TNarrative;
530
- mode?: string;
531
- orderedBy?: TCodeableConcept;
532
- entry?: TReference[];
533
- emptyReason?: TCodeableConcept;
534
- section?: TCompositionSection[];
535
- };
536
-
537
521
  type TDomainResource = {
538
522
  resourceType?: string;
539
523
  id?: string;
@@ -548,22 +532,21 @@ type TDomainResource = {
548
532
 
549
533
  declare enum IPSSections {
550
534
  PATIENT = "Patient",
551
- ALLERGIES = "AllergyIntoleranceSection",
552
- MEDICATIONS = "MedicationSection",
553
535
  PROBLEMS = "ProblemSection",
536
+ ALLERGIES = "AllergyIntoleranceSection",
537
+ MEDICATIONS = "MedicationSummarySection",
554
538
  IMMUNIZATIONS = "ImmunizationSection",
555
- VITAL_SIGNS = "VitalSignsSection",
539
+ DIAGNOSTIC_REPORTS = "ResultsSection",
540
+ PROCEDURES = "HistoryOfProceduresSection",
556
541
  MEDICAL_DEVICES = "MedicalDeviceSection",
557
- DIAGNOSTIC_REPORTS = "DiagnosticReportSection",
558
- PROCEDURES = "ProcedureSection",
559
- FAMILY_HISTORY = "FamilyHistorySection",
560
- SOCIAL_HISTORY = "SocialHistorySection",
561
- PREGNANCY_HISTORY = "PregnancyHistorySection",
542
+ ADVANCE_DIRECTIVES = "AdvanceDirectivesSection",
562
543
  FUNCTIONAL_STATUS = "FunctionalStatusSection",
563
- MEDICAL_HISTORY = "MedicalHistorySection",
564
- CARE_PLAN = "CarePlanSection",
565
- CLINICAL_IMPRESSION = "ClinicalImpressionSection",
566
- ADVANCE_DIRECTIVES = "AdvanceDirectivesSection"
544
+ PREGNANCY_HISTORY = "HistoryOfPregnancySection",
545
+ CARE_PLAN = "PlanOfCareSection",
546
+ MEDICAL_HISTORY = "HistoryOfPastIllnessSection",
547
+ SOCIAL_HISTORY = "SocialHistorySection",
548
+ VITAL_SIGNS = "VitalSignsSection",
549
+ FAMILY_HISTORY = "FamilyHistorySection"
567
550
  }
568
551
 
569
552
  type TBundleLink = {
@@ -635,7 +618,6 @@ type TBundle = {
635
618
  declare class ComprehensiveIPSCompositionBuilder {
636
619
  private patient;
637
620
  private sections;
638
- private mandatorySectionsAdded;
639
621
  private resources;
640
622
  /**
641
623
  * sets the patient resource for the IPS Composition.
@@ -646,25 +628,16 @@ declare class ComprehensiveIPSCompositionBuilder {
646
628
  /**
647
629
  * Adds a section to the composition with async HTML minification
648
630
  * @param sectionType - IPS section type
649
- * @param resources - Array of domain resources
631
+ * @param validResources - Array of domain resources
650
632
  * @param timezone - Optional timezone to use for date formatting
651
- * @param options - Optional configuration options
652
633
  */
653
- addSectionAsync<T extends TDomainResource>(sectionType: IPSSections, resources: T[], timezone: string | undefined, options?: {
654
- isOptional?: boolean;
655
- customLoincCode?: string;
656
- }): Promise<this>;
634
+ addSectionAsync<T extends TDomainResource>(sectionType: IPSSections, validResources: T[], timezone: string | undefined): Promise<this>;
657
635
  /**
658
636
  * Reads a FHIR Bundle and extracts resources for each section defined in IPSSections.
659
637
  * @param bundle - FHIR Bundle containing resources
660
638
  * @param timezone - Optional timezone to use for date formatting
661
639
  */
662
640
  readBundleAsync(bundle: TBundle, timezone: string | undefined): Promise<this>;
663
- /**
664
- * Builds the final Composition sections, ensuring all mandatory sections are present.
665
- * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
666
- */
667
- build(timezone: string | undefined): TCompositionSection[];
668
641
  /**
669
642
  * Builds a complete FHIR Bundle containing the Composition and all resources.
670
643
  * @param authorOrganizationId - ID of the authoring organization (e.g., hospital or clinic)
@@ -673,12 +646,6 @@ declare class ComprehensiveIPSCompositionBuilder {
673
646
  * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
674
647
  */
675
648
  buildBundleAsync(authorOrganizationId: string, authorOrganizationName: string, baseUrl: string, timezone: string | undefined): Promise<TBundle>;
676
- /**
677
- * Creates a narrative for the composition based on the patient and sections.
678
- * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
679
- * @private
680
- */
681
- private createCompositionNarrativeAsync;
682
649
  }
683
650
 
684
651
  interface Narrative {
@@ -695,10 +662,9 @@ declare class NarrativeGenerator {
695
662
  * @param section - IPS section type
696
663
  * @param resources - Array of domain resources
697
664
  * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
698
- * @param wrapInXhtml - Whether to wrap the content in XHTML div
699
665
  * @returns Generated HTML content or undefined if no resources
700
666
  */
701
- static generateNarrativeContentAsync<T extends TDomainResource>(section: IPSSections, resources: T[], timezone: string | undefined, wrapInXhtml?: boolean): Promise<string | undefined>;
667
+ static generateNarrativeContentAsync<T extends TDomainResource>(section: IPSSections, resources: T[], timezone: string | undefined): Promise<string | undefined>;
702
668
  /**
703
669
  * Minifies HTML content asynchronously using html-minifier-terser
704
670
  * @param html - HTML content to minify
@@ -719,17 +685,9 @@ declare class NarrativeGenerator {
719
685
  * @param resources - Array of domain resources
720
686
  * @param timezone - Optional timezone to use for date formatting
721
687
  * @param minify - Whether to minify the HTML content (default: true)
722
- * @param wrapInXhtml - Whether to wrap the content in XHTML div
723
688
  * @returns Promise that resolves to a FHIR Narrative object or undefined if no resources
724
689
  */
725
- static generateNarrativeAsync<T extends TDomainResource>(section: IPSSections, resources: T[], timezone: string | undefined, minify: boolean | undefined, wrapInXhtml: boolean): Promise<Narrative | undefined>;
726
- /**
727
- * Wrap content in XHTML div with FHIR namespace asynchronously
728
- * @param content - HTML content to wrap
729
- * @param minify - Whether to minify the HTML content before wrapping (default: false)
730
- * @returns Promise that resolves to XHTML div string
731
- */
732
- static wrapInXhtmlAsync(content: string, minify?: boolean): Promise<string>;
690
+ static generateNarrativeAsync<T extends TDomainResource>(section: IPSSections, resources: T[], timezone: string | undefined, minify?: boolean): Promise<Narrative | undefined>;
733
691
  }
734
692
 
735
693
  declare const myPackage: (taco?: string) => string;
package/dist/index.d.ts CHANGED
@@ -518,22 +518,6 @@ type TPatient = {
518
518
  link?: TPatientLink[];
519
519
  };
520
520
 
521
- type TCompositionSection = {
522
- id?: string;
523
- extension?: TExtension[];
524
- modifierExtension?: TExtension[];
525
- title?: string;
526
- code?: TCodeableConcept;
527
- author?: TReference[];
528
- focus?: TReference;
529
- text?: TNarrative;
530
- mode?: string;
531
- orderedBy?: TCodeableConcept;
532
- entry?: TReference[];
533
- emptyReason?: TCodeableConcept;
534
- section?: TCompositionSection[];
535
- };
536
-
537
521
  type TDomainResource = {
538
522
  resourceType?: string;
539
523
  id?: string;
@@ -548,22 +532,21 @@ type TDomainResource = {
548
532
 
549
533
  declare enum IPSSections {
550
534
  PATIENT = "Patient",
551
- ALLERGIES = "AllergyIntoleranceSection",
552
- MEDICATIONS = "MedicationSection",
553
535
  PROBLEMS = "ProblemSection",
536
+ ALLERGIES = "AllergyIntoleranceSection",
537
+ MEDICATIONS = "MedicationSummarySection",
554
538
  IMMUNIZATIONS = "ImmunizationSection",
555
- VITAL_SIGNS = "VitalSignsSection",
539
+ DIAGNOSTIC_REPORTS = "ResultsSection",
540
+ PROCEDURES = "HistoryOfProceduresSection",
556
541
  MEDICAL_DEVICES = "MedicalDeviceSection",
557
- DIAGNOSTIC_REPORTS = "DiagnosticReportSection",
558
- PROCEDURES = "ProcedureSection",
559
- FAMILY_HISTORY = "FamilyHistorySection",
560
- SOCIAL_HISTORY = "SocialHistorySection",
561
- PREGNANCY_HISTORY = "PregnancyHistorySection",
542
+ ADVANCE_DIRECTIVES = "AdvanceDirectivesSection",
562
543
  FUNCTIONAL_STATUS = "FunctionalStatusSection",
563
- MEDICAL_HISTORY = "MedicalHistorySection",
564
- CARE_PLAN = "CarePlanSection",
565
- CLINICAL_IMPRESSION = "ClinicalImpressionSection",
566
- ADVANCE_DIRECTIVES = "AdvanceDirectivesSection"
544
+ PREGNANCY_HISTORY = "HistoryOfPregnancySection",
545
+ CARE_PLAN = "PlanOfCareSection",
546
+ MEDICAL_HISTORY = "HistoryOfPastIllnessSection",
547
+ SOCIAL_HISTORY = "SocialHistorySection",
548
+ VITAL_SIGNS = "VitalSignsSection",
549
+ FAMILY_HISTORY = "FamilyHistorySection"
567
550
  }
568
551
 
569
552
  type TBundleLink = {
@@ -635,7 +618,6 @@ type TBundle = {
635
618
  declare class ComprehensiveIPSCompositionBuilder {
636
619
  private patient;
637
620
  private sections;
638
- private mandatorySectionsAdded;
639
621
  private resources;
640
622
  /**
641
623
  * sets the patient resource for the IPS Composition.
@@ -646,25 +628,16 @@ declare class ComprehensiveIPSCompositionBuilder {
646
628
  /**
647
629
  * Adds a section to the composition with async HTML minification
648
630
  * @param sectionType - IPS section type
649
- * @param resources - Array of domain resources
631
+ * @param validResources - Array of domain resources
650
632
  * @param timezone - Optional timezone to use for date formatting
651
- * @param options - Optional configuration options
652
633
  */
653
- addSectionAsync<T extends TDomainResource>(sectionType: IPSSections, resources: T[], timezone: string | undefined, options?: {
654
- isOptional?: boolean;
655
- customLoincCode?: string;
656
- }): Promise<this>;
634
+ addSectionAsync<T extends TDomainResource>(sectionType: IPSSections, validResources: T[], timezone: string | undefined): Promise<this>;
657
635
  /**
658
636
  * Reads a FHIR Bundle and extracts resources for each section defined in IPSSections.
659
637
  * @param bundle - FHIR Bundle containing resources
660
638
  * @param timezone - Optional timezone to use for date formatting
661
639
  */
662
640
  readBundleAsync(bundle: TBundle, timezone: string | undefined): Promise<this>;
663
- /**
664
- * Builds the final Composition sections, ensuring all mandatory sections are present.
665
- * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
666
- */
667
- build(timezone: string | undefined): TCompositionSection[];
668
641
  /**
669
642
  * Builds a complete FHIR Bundle containing the Composition and all resources.
670
643
  * @param authorOrganizationId - ID of the authoring organization (e.g., hospital or clinic)
@@ -673,12 +646,6 @@ declare class ComprehensiveIPSCompositionBuilder {
673
646
  * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
674
647
  */
675
648
  buildBundleAsync(authorOrganizationId: string, authorOrganizationName: string, baseUrl: string, timezone: string | undefined): Promise<TBundle>;
676
- /**
677
- * Creates a narrative for the composition based on the patient and sections.
678
- * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
679
- * @private
680
- */
681
- private createCompositionNarrativeAsync;
682
649
  }
683
650
 
684
651
  interface Narrative {
@@ -695,10 +662,9 @@ declare class NarrativeGenerator {
695
662
  * @param section - IPS section type
696
663
  * @param resources - Array of domain resources
697
664
  * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
698
- * @param wrapInXhtml - Whether to wrap the content in XHTML div
699
665
  * @returns Generated HTML content or undefined if no resources
700
666
  */
701
- static generateNarrativeContentAsync<T extends TDomainResource>(section: IPSSections, resources: T[], timezone: string | undefined, wrapInXhtml?: boolean): Promise<string | undefined>;
667
+ static generateNarrativeContentAsync<T extends TDomainResource>(section: IPSSections, resources: T[], timezone: string | undefined): Promise<string | undefined>;
702
668
  /**
703
669
  * Minifies HTML content asynchronously using html-minifier-terser
704
670
  * @param html - HTML content to minify
@@ -719,17 +685,9 @@ declare class NarrativeGenerator {
719
685
  * @param resources - Array of domain resources
720
686
  * @param timezone - Optional timezone to use for date formatting
721
687
  * @param minify - Whether to minify the HTML content (default: true)
722
- * @param wrapInXhtml - Whether to wrap the content in XHTML div
723
688
  * @returns Promise that resolves to a FHIR Narrative object or undefined if no resources
724
689
  */
725
- static generateNarrativeAsync<T extends TDomainResource>(section: IPSSections, resources: T[], timezone: string | undefined, minify: boolean | undefined, wrapInXhtml: boolean): Promise<Narrative | undefined>;
726
- /**
727
- * Wrap content in XHTML div with FHIR namespace asynchronously
728
- * @param content - HTML content to wrap
729
- * @param minify - Whether to minify the HTML content before wrapping (default: false)
730
- * @returns Promise that resolves to XHTML div string
731
- */
732
- static wrapInXhtmlAsync(content: string, minify?: boolean): Promise<string>;
690
+ static generateNarrativeAsync<T extends TDomainResource>(section: IPSSections, resources: T[], timezone: string | undefined, minify?: boolean): Promise<Narrative | undefined>;
733
691
  }
734
692
 
735
693
  declare const myPackage: (taco?: string) => string;