@medic/cht-datasource
    Preparing search index...

    Function update

    • Returns a function for updating a report from the given data context.

      Parameters

      Returns <T extends Report.v1.Report | ReportWithLineage>(
          updated: UpdateReportInput<T>,
      ) => Promise<T>

      a function for updating a report

        • <T extends Report.v1.Report | ReportWithLineage>(
              updated: UpdateReportInput<T>,
          ): Promise<T>
        • Updates an existing report to have the provided data.

          Type Parameters

          Parameters

          • updated: UpdateReportInput<T>

            the updated report data. The complete data for the report must be provided. Existing fields not included in the updated data will be removed from the report. If the provided parent/patient/place lineage is hydrated (e.g. for a ReportWithLineage), the lineage will be properly dehydrated before being stored.

          Returns Promise<T>

          the updated report with the new _rev value

          InvalidArgumentError if _id is not provided

          ResourceNotFoundError if _id does not identify an existing report @throws InvalidArgumentError if _revis not provided or does not match the report's current_revvalue @throws InvalidArgumentError ifformis not provided or is not a supported form id @throws InvalidArgumentError ifcontactis not provided or is not a valid contact @throws InvalidArgumentError if any of the following read-only properties are changed:reported_date, type`

      Error if a data context is not provided