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

    Function create

    • Returns a function for creating a person from the given data context.

      Parameters

      Returns (input: PersonInput) => Promise<Person.v1.Person>

      a function for creating a person.

        • (input: PersonInput): Promise<Person.v1.Person>
        • Creates a new person record.

          Parameters

          Returns Promise<Person.v1.Person>

          the created person record

          InvalidArgumentError if type is not provided or is not a supported person contact type

          InvalidArgumentError if name is not provided

          InvalidArgumentError if parent is not provided or is not the identifier of a valid contact. The parent contact's type must be one of the supported parent contact types for the new person.

          InvalidArgumentError if the provided reported_date is not in a valid format. Valid formats are 'YYYY-MM-DDTHH:mm:ssZ', 'YYYY-MM-DDTHH:mm:ss.SSSZ', or .

      Error if a data context is not provided