> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.taigabilling.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.taigabilling.com/_mcp/server.

# Pre Encounter Patients V 1 Create With Mrn

POST https://api.taigabilling.com/patients/v1/with_mrn
Content-Type: application/json

Adds a patient and hydrates their MRN with a pre-existing MRN. Once this patient is created their MRN will not be editable. BadRequestError is returned when the MRN is greater than 20 characters. A 409 means the MRN or demographics matched an existing patient: the body carries `data.potentialDuplicates[]` with `existingPatientId` and `existingPatientMrn` for patients in your organization, and an empty list means the identifier is unavailable. Read the current `version` with GET /patients/v1/\{id} before a PUT.

Reference: https://docs.taigabilling.com/api-reference/pre-encounter-patients-v-1/pre-encounter-patients-v-1-create-with-mrn

## Authentication

- `Authorization` header (bearer token, required) — Send your Taiga API key as a Bearer token. Create and manage keys in the Taiga developer portal.

## Servers

- `https://api.taigabilling.com` (Production, default)
- `https://api-staging.taigabilling.com` (Staging)

## Request

### Query parameters

- `skip_duplicate_check` (boolean, optional)

### Body (application/json)

This endpoint expects a pre-encounterpatientsv1MutablePatientWithMrn.

- `biological_sex` (enum, required) — The biological sex of the patient. This corresponds to the HL7 AdministrativeGender https://www.hl7.org/fhir/valueset-administrative-gender.html
  - Allowed values: `FEMALE`, `MALE`, `UNKNOWN`, `REFUSED`
- `birth_date` (date, required)
- `contacts` (list of pre-encounterpatientsv1Contact, required) — Contacts for the patient.
- `filing_order` (pre-encounterpatientsv1FilingOrder, required) — The patient's active coverages, in order of primary, secondary, etc.
- `general_practitioners` (list of pre-encounterExternalProvider, required)
- `mrn` (string, required) — The medical record number for the patient.
- `name` (pre-encounterHumanName, required)
- `other_addresses` (list of pre-encounterAddress, required) — Other addresses for the patient.
- `other_names` (list of pre-encounterHumanName, required) — Other names for the patient.
- `other_telecoms` (list of pre-encounterContactPoint, required) — Other phone numbers for the patient.
- `primary_address` (pre-encounterAddress, required) — The primary address for the patient.
- `advanced_directives` (list of enum, optional, nullable)
  - Allowed values: `NONE`, `DURABLE_POWER_OF_ATTORNEY`, `LIVING_WILL`, `DO_NOT_RESUSCITATE`, `STANDARD_PRECAUTIONS`, `FALL_RISK`
- `authorizations` (list of pre-encounterpatientsv1Authorization, optional, nullable)
- `coverages_for_related_causes` (pre-encounterpatientsv1CoveragesForRelatedCauses, optional, nullable) — Additional coverages for the patient applicable to related causes such as Auto or Workers Comp
- `custom_metadata` (list of pre-encounterpatientsv1CustomMetadataEntry, optional, nullable) — Custom key/value metadata attached to this patient, grouped by the MetadataSchema that defines the keys' types. Configure schemas via the metadata-schemas API. Values are validated against the referenced schema on write.
- `deceased` (datetime, optional, nullable) — Time of death for the patient. Leave unset if the patient is not deceased.
- `disability_status` (enum, optional, nullable)
  - Allowed values: `DISABLED`, `NON_DISABLED`
- `do_not_invoice_reason` (enum, optional, nullable) — If this value is defined, the customer will not be invoiced.
  - Allowed values: `BANKRUPTCY`, `DECEASED`, `HARDSHIP`, `OTHER`, `COLLECTIONS`, `BAD_ADDRESS`, `PROFESSIONAL_COURTESY`
- `electronic_communication_consent` (pre-encounterpatientsv1ElectronicCommunicationConsent, optional, nullable) — Granular consent for electronic communication channels.
- `email` (string, optional, nullable)
- `ethnicity` (enum, optional, nullable)
  - Allowed values: `HISPANIC_OR_LATINO`, `NOT_HISPANIC_OR_LATINO`, `UNKNOWN`, `REFUSED`
- `external_provenance` (pre-encounterpatientsv1ExternalProvenance, optional, nullable) — Information about the upstream system that owns this patient data. Leave unset if Taiga owns patient data.
- `gender` (enum, optional, nullable)
  - Allowed values: `MAN`, `WOMAN`, `NON_BINARY`, `TWO_SPIRIT`, `FEMALE_TO_MALE`, `MALE_TO_FEMALE`, `OTHER`, `UNKNOWN`, `REFUSED`
- `guarantor` (pre-encounterpatientsv1Guarantor, optional, nullable)
- `hipaa_code` (string, optional, nullable)
- `inferred_patient_metadata` (pre-encounterpatientsv1InferredPatientMetadata, optional, nullable) — Metadata for the patient used for patient inference from encounters.
- `language` (string, optional, nullable)
- `marital_status` (enum, optional, nullable)
  - Allowed values: `ANNULLED`, `DIVORCED`, `INTERLOCUTORY`, `SEPARATED`, `MARRIED`, `COMMON_LAW`, `POLYGAMOUS`, `DOMESTIC_PARTNER`, `UNMARRIED`, `NEVER_MARRIED`, `WIDOWED`, `UNKNOWN`
- `multiple_birth` (integer, optional, nullable) — The number of siblings the patient was born with. Leave unset if the patient was not part of a multiple birth.
- `non_insurance_payer_associations` (list of pre-encounterCanonicalNonInsurancePayerAssociation, optional, nullable)
- `note_ids` (list of string, optional, nullable)
- `orcon` (boolean, optional, nullable) — ORCON (Originator Controlled) - When set to true, the Taiga system will hide this patient from downstream integrations. Updates made in the Taiga UI will unset this flag. Defaults to false.
- `origination_detail` (pre-encounterpatientsv1OriginationDetail, optional, nullable) — Information about the patient source, if applicable.
- `other_identifiers` (list of pre-encounterExternalIdentifier, optional, nullable) — Other identifiers for the patient.
- `photo` (string, optional, nullable)
- `primary_service_facility_id` (string, optional, nullable)
- `primary_telecom` (pre-encounterContactPoint, optional, nullable) — The primary phone number for the patient.
- `pronouns` (list of string, optional, nullable) — The pronouns of the patient.
- `race` (enum, optional, nullable)
  - Allowed values: `AMERICAN_INDIAN_OR_ALASKA_NATIVE`, `WHITE`, `BLACK`, `ASIAN`, `NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER`, `MIDDLE_EASTERN_OR_NORTH_AFRICAN`, `OTHER`, `UNKNOWN`, `REFUSED`
- `referrals` (list of pre-encounterpatientsv1Referral, optional, nullable)
- `self_pay` (boolean, optional, nullable)
- `service_facilities` (list of pre-encounterPatientServiceFacility, optional, nullable) — Associated service facilities for this patient.
- `sexual_orientation` (enum, optional, nullable) — The sexual orientation of the patient.
  - Allowed values: `HETEROSEXUAL`, `HOMOSEXUAL`, `BISEXUAL`, `TWO_SPIRIT`, `OTHER`, `UNKNOWN`, `REFUSED`
- `social_security_number` (string, optional, nullable)
- `tag_ids` (list of string, optional, nullable)
- `electronic_communication_opt_in` (boolean, optional, nullable, deprecated) — Use electronic_communication_consent for granular channel-level consent. This field is kept in sync automatically but should not be used for new integrations.
- `non_insurance_payers` (list of string, optional, nullable, deprecated)

## Response

### 200

- `biological_sex` (enum, required) — The biological sex of the patient. This corresponds to the HL7 AdministrativeGender https://www.hl7.org/fhir/valueset-administrative-gender.html
  - Allowed values: `FEMALE`, `MALE`, `UNKNOWN`, `REFUSED`
- `birth_date` (date, required)
- `contacts` (list of pre-encounterpatientsv1Contact, required) — Contacts for the patient.
- `deactivated` (boolean, required) — True if the object is deactivated. Deactivated objects are not returned in search results but are returned in all other endpoints including scan.
- `filing_order` (pre-encounterpatientsv1FilingOrder, required) — The patient's active coverages, in order of primary, secondary, etc.
- `general_practitioners` (list of pre-encounterExternalProvider, required)
- `id` (string, required) — The unique UUID identifier for a Patient. Patient ID is used in machine contexts.
- `mrn` (string, required) — The medical record number for the patient. Human-friendly Taiga generated MRNs are of the form "YYMMDDXXXX", where "YYMMDD" is the date of patient creation and "XXXX" is a zero-padded incrementing integer.
- `name` (pre-encounterHumanName, required)
- `organization_id` (string, required) — The organization that owns this object.
- `other_addresses` (list of pre-encounterAddress, required) — Other addresses for the patient.
- `other_names` (list of pre-encounterHumanName, required) — Other names for the patient.
- `other_telecoms` (list of pre-encounterContactPoint, required) — Other phone numbers for the patient.
- `primary_address` (pre-encounterAddress, required) — The primary address for the patient.
- `updated_at` (datetime, required)
- `updating_user_id` (string, required) — The user ID of the user who last updated the object.
- `version` (integer, required) — The version of the object. Any update to any property of an object object will create a new version.
- `advanced_directives` (list of enum, optional, nullable)
  - Allowed values: `NONE`, `DURABLE_POWER_OF_ATTORNEY`, `LIVING_WILL`, `DO_NOT_RESUSCITATE`, `STANDARD_PRECAUTIONS`, `FALL_RISK`
- `authorizations` (list of pre-encounterpatientsv1Authorization, optional, nullable)
- `coverages_for_related_causes` (pre-encounterpatientsv1CoveragesForRelatedCauses, optional, nullable) — Additional coverages for the patient applicable to related causes such as Auto or Workers Comp
- `custom_metadata` (list of pre-encounterpatientsv1CustomMetadataEntry, optional, nullable) — Custom key/value metadata attached to this patient, grouped by the MetadataSchema that defines the keys' types. Configure schemas via the metadata-schemas API. Values are validated against the referenced schema on write.
- `deceased` (datetime, optional, nullable) — Time of death for the patient. Leave unset if the patient is not deceased.
- `disability_status` (enum, optional, nullable)
  - Allowed values: `DISABLED`, `NON_DISABLED`
- `do_not_invoice_reason` (enum, optional, nullable) — If this value is defined, the customer will not be invoiced.
  - Allowed values: `BANKRUPTCY`, `DECEASED`, `HARDSHIP`, `OTHER`, `COLLECTIONS`, `BAD_ADDRESS`, `PROFESSIONAL_COURTESY`
- `electronic_communication_consent` (pre-encounterpatientsv1ElectronicCommunicationConsent, optional, nullable) — Granular consent for electronic communication channels.
- `email` (string, optional, nullable)
- `ethnicity` (enum, optional, nullable)
  - Allowed values: `HISPANIC_OR_LATINO`, `NOT_HISPANIC_OR_LATINO`, `UNKNOWN`, `REFUSED`
- `external_provenance` (pre-encounterpatientsv1ExternalProvenance, optional, nullable) — Information about the upstream system that owns this patient data. Leave unset if Taiga owns patient data.
- `gender` (enum, optional, nullable)
  - Allowed values: `MAN`, `WOMAN`, `NON_BINARY`, `TWO_SPIRIT`, `FEMALE_TO_MALE`, `MALE_TO_FEMALE`, `OTHER`, `UNKNOWN`, `REFUSED`
- `guarantor` (pre-encounterpatientsv1Guarantor, optional, nullable)
- `hipaa_code` (string, optional, nullable)
- `inferred_patient_metadata` (pre-encounterpatientsv1InferredPatientMetadata, optional, nullable) — Metadata for the patient used for patient inference from encounters.
- `language` (string, optional, nullable)
- `marital_status` (enum, optional, nullable)
  - Allowed values: `ANNULLED`, `DIVORCED`, `INTERLOCUTORY`, `SEPARATED`, `MARRIED`, `COMMON_LAW`, `POLYGAMOUS`, `DOMESTIC_PARTNER`, `UNMARRIED`, `NEVER_MARRIED`, `WIDOWED`, `UNKNOWN`
- `multiple_birth` (integer, optional, nullable) — The number of siblings the patient was born with. Leave unset if the patient was not part of a multiple birth.
- `non_insurance_payer_associations` (list of pre-encounterCanonicalNonInsurancePayerAssociation, optional, nullable)
- `note_ids` (list of string, optional, nullable)
- `orcon` (boolean, optional, nullable) — ORCON (Originator Controlled) - When set to true, the Taiga system will hide this patient from downstream integrations. Updates made in the Taiga UI will unset this flag. Defaults to false.
- `origination_detail` (pre-encounterpatientsv1OriginationDetail, optional, nullable) — Information about the patient source, if applicable.
- `other_identifiers` (list of pre-encounterExternalIdentifier, optional, nullable) — Other identifiers for the patient.
- `photo` (string, optional, nullable)
- `primary_service_facility_id` (string, optional, nullable)
- `primary_telecom` (pre-encounterContactPoint, optional, nullable) — The primary phone number for the patient.
- `pronouns` (list of string, optional, nullable) — The pronouns of the patient.
- `race` (enum, optional, nullable)
  - Allowed values: `AMERICAN_INDIAN_OR_ALASKA_NATIVE`, `WHITE`, `BLACK`, `ASIAN`, `NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER`, `MIDDLE_EASTERN_OR_NORTH_AFRICAN`, `OTHER`, `UNKNOWN`, `REFUSED`
- `referrals` (list of pre-encounterpatientsv1Referral, optional, nullable)
- `self_pay` (boolean, optional, nullable)
- `service_facilities` (list of pre-encounterPatientServiceFacility, optional, nullable) — Associated service facilities for this patient.
- `sexual_orientation` (enum, optional, nullable) — The sexual orientation of the patient.
  - Allowed values: `HETEROSEXUAL`, `HOMOSEXUAL`, `BISEXUAL`, `TWO_SPIRIT`, `OTHER`, `UNKNOWN`, `REFUSED`
- `social_security_number` (string, optional, nullable)
- `tag_ids` (list of string, optional, nullable)
- `electronic_communication_opt_in` (boolean, optional, nullable, deprecated) — Use electronic_communication_consent for granular channel-level consent. This field is kept in sync automatically but should not be used for new integrations.
- `non_insurance_payers` (list of string, optional, nullable, deprecated)

## Errors

### 400 Bad Request Error

- `PreEncounter_patients_v1_create_with_mrnRequestBadRequestError`
  - PreEncounterPatientsV1CreateWithMrnRequestBadRequestError0

### 409 Conflict Error

Either a version conflict (`latest_version` is set) or a duplicate patient: `data.potentialDuplicates[]` lists `existingPatientId` and `existingPatientMrn` for matching patients in your organization. An empty list means the identifier is unavailable. Read the current `version` with GET /patients/v1/\{id} before a PUT.

- `PreEncounter_patients_v1_create_with_mrnRequestConflictError`
  - PreEncounterPatientsV1CreateWithMrnRequestConflictError0
  - PatientDuplicateConflictErrorBody: PatientDuplicateConflictErrorBody

## Types

### pre-encounterpatientsv1Contact

- `relationship` (list of enum, required)
  - Allowed values: `SELF`, `SPOUSE`, `CHILD`, `COMMON_LAW_SPOUSE`, `OTHER`
- `name` (pre-encounterHumanName, required)
- `telecoms` (list of pre-encounterContactPoint, required)
- `addresses` (list of pre-encounterAddress, required)
- `period` (pre-encounterPeriod, optional, nullable)
- `hipaa_authorization` (boolean, optional, nullable)

### pre-encounterpatientsv1FilingOrder

The patient's active coverages, in order of primary, secondary, etc.

- `coverages` (list of string, required)

### pre-encounterExternalProvider

- `name` (pre-encounterHumanName, required)
- `telecoms` (list of pre-encounterContactPoint, required)
- `type` (enum, optional, nullable) — Defaults to ATTENDING.
  - Allowed values: `PRIMARY`, `REFERRING`, `ATTENDING`
- `npi` (string, optional, nullable)
- `addresses` (list of pre-encounterAddress, optional, nullable)
- `period` (pre-encounterPeriod, optional, nullable)
- `canonical_id` (string, optional, nullable) — The unique identifier for a provider configured in the Taiga system
- `fax` (string, optional, nullable)
- `other_fax_numbers` (list of string, optional, nullable)
- `emails` (list of string, optional, nullable)
- `service_facilities` (list of pre-encounterPatientServiceFacility, optional, nullable) — Associated service facilities for this provider.

### pre-encounterHumanName

- `family` (string, required)
- `given` (list of string, required)
- `use` (enum, required)
  - Allowed values: `USUAL`, `OFFICIAL`, `TEMP`, `NICKNAME`, `ANONYMOUS`, `OLD`, `MAIDEN`
- `period` (pre-encounterPeriod, optional, nullable)
- `suffix` (string, optional, nullable)

### pre-encounterAddress

- `use` (enum, required)
  - Allowed values: `HOME`, `WORK`, `TEMP`, `OLD`, `BILLING`
- `line` (list of string, required)
- `city` (string, required)
- `state` (string, required)
- `postal_code` (string, required)
- `country` (string, required)
- `administrative_area` (string, optional, nullable) — The top-level administrative subdivision of the country for addresses outside the US — for example a Canadian province, a UK county, or a Japanese prefecture. Only permitted on international addresses: `country` must be present and non-US, and `state` must be "FC" (the X12 foreign-country sentinel). For US addresses use `state` instead.
- `county` (string, optional, nullable)
- `period` (pre-encounterPeriod, optional, nullable)

### pre-encounterContactPoint

- `value` (string, required)
- `use` (enum, required)
  - Allowed values: `HOME`, `WORK`, `TEMP`, `OLD`, `MOBILE`
- `period` (pre-encounterPeriod, optional, nullable)

### pre-encounterpatientsv1Authorization

- `payer_id` (string, required) — The unique identifier for a Payer in the database
- `payer_name` (string, required)
- `authorization_number` (string, required)
- `cpt_code` (string, required)
- `units` (enum, required)
  - Allowed values: `VISIT`, `UNIT`
- `additional_payer_information` (pre-encounterAdditionalPayerInformation, optional, nullable)
- `apply_for_all_cpt_codes` (boolean, optional, nullable) — If true, then the authorization will apply for all claims for the payer that fall in range the `period`.
- `no_prior_authorization_required` (boolean, optional, nullable) — If true, indicates that prior authorization is not required and prior authorization number will not be set on the claim for this authorization.
- `quantity` (integer, optional, nullable)
- `period` (pre-encounterPeriod, optional, nullable)
- `notes` (string, optional, nullable)
- `billing_provider_npi` (string, optional, nullable) — The NPI of the billing provider for which this authorization applies.
- `service_facility` (pre-encounterPatientServiceFacility, optional, nullable) — When set, specifies the service facility for which this authorization applies.
- `dx_codes` (list of string, optional, nullable) — When set, the authorization will only apply when at least one of these diagnosis codes is found on the claim/service lines (in addition to other criteria).

### pre-encounterpatientsv1CoveragesForRelatedCauses

Additional coverages for the patient applicable to related causes such as Auto or Workers Comp

- `coverages` (list of string, required)

### pre-encounterpatientsv1CustomMetadataEntry

A set of custom key/value pairs validated against a single MetadataSchema.

- `metadata_schema_id` (string, required) — The unique identifier for a custom MetadataSchema.
- `key_value_pairs` (map from string to any, required) — The custom values. Each key must be a field defined on the referenced MetadataSchema and each value must match that field's declared type.

### pre-encounterpatientsv1ElectronicCommunicationConsent

Granular consent for electronic communication channels.

- `text_communication_consent` (boolean, optional, nullable) — Consent for text/SMS communication.
- `email_communication_consent` (boolean, optional, nullable) — Consent for email communication.

### pre-encounterpatientsv1ExternalProvenance

Information about the upstream system that owns this patient data.

- `external_id` (string, required)
- `system_name` (string, required)

### pre-encounterpatientsv1Guarantor

- `name` (pre-encounterHumanName, required)
- `address` (pre-encounterAddress, required)
- `telecom` (pre-encounterContactPoint, optional, nullable)
- `email` (string, optional, nullable)
- `birth_date` (date, optional, nullable)

### pre-encounterpatientsv1InferredPatientMetadata

- `inferred_encounter_id` (string, required)
- `inferred_encounter_latest_date_of_service` (date, required)

### pre-encounterCanonicalNonInsurancePayerAssociation

- `id` (string, required) — The unique identifier for a non-insurance payer configured in the Taiga system
- `member_id` (string, optional, nullable)
- `period` (pre-encounterPeriod, optional, nullable)
- `clinical_trial_info` (list of pre-encounterCanonicalClinicalTrialAssociation, optional, nullable) — A patient cannot be associated with a given trial more than once

### pre-encounterpatientsv1OriginationDetail

- `referral_source` (enum, required)
  - Allowed values: `HOSPITAL`, `REFERRING_MD`, `SELF`, `OTHER`
- `referring_provider` (pre-encounterExternalProvider, optional, nullable)
- `specialization_categories` (list of enum, optional, nullable)
  - Allowed values: `BEHAVIORAL_HEALTH_THERAPY`, `CARDIOLOGY`, `DERMATOLOGY`, `ENDOCRINOLOGY`, `ENT`, `GASTROENTEROLOGY`, `GENERAL_SURGERY`, `GENETICS`, `HEMATOLOGY`, `INFECTIOUS_DISEASE`, `NEUROLOGY`, `NUTRITIONAL_THERAPY`, `OB_GYN`, `ONCOLOGY`, `OPHTHALMOLOGY`, `ORTHOPEDICS`, `PAIN_MANAGEMENT`, `PEDIATRICS`, `PHYSICAL_THERAPY`, `PODIATRY`, `PRIMARY_CARE`, `PSYCHIATRY`, `PULMONOLOGY`, `RADIOLOGY`, `RHEUMATOLOGY`, `SCREENING`, `UROLOGY`, `OTHER`
- `referral_type` (enum, optional, nullable)
  - Allowed values: `DIRECTED`, `ROTATION`, `OVERNIGHT`

### pre-encounterExternalIdentifier

An external identifier for a patient

- `value` (string, required)
- `system` (string, required)
- `period` (pre-encounterPeriod, optional, nullable)

### pre-encounterpatientsv1Referral

- `provider` (pre-encounterExternalProvider, required)
- `referral_number` (string, required)
- `period` (pre-encounterPeriod, optional, nullable)
- `notes` (string, optional, nullable)
- `serviceFacility` (pre-encounterPatientServiceFacility, optional, nullable) — Represents a canonical service facility attached to a patient or patient dependent object
- `units` (enum, optional, nullable)
  - Allowed values: `VISIT`, `UNIT`
- `quantity` (integer, optional, nullable)
- `cptCodes` (list of string, optional, nullable)
- `applyForAllCptCodes` (boolean, optional, nullable)

### pre-encounterPatientServiceFacility

Represents a canonical service facility attached to a patient or patient dependent object

- `service_facility_id` (string, required) — The unique identifier for a service facility configured in the Taiga system

### PreEncounterPatientsV1CreateWithMrnRequestBadRequestError0

- `errorName` (enum, optional)
  - Allowed values: `VersionConflictError`
- `content` (pre-encounterErrorBase4xx, optional)

### PreEncounterPatientsV1CreateWithMrnRequestConflictError0

- `errorName` (enum, optional)
  - Allowed values: `VersionConflictError`
- `content` (pre-encounterVersionConflictErrorBody, optional)

### PatientDuplicateConflictErrorBody

A patient create that matched an existing patient. `data.potentialDuplicates` lists only patients visible to your organization; an empty list means the identifier is unavailable.

- `data` (PatientDuplicateConflictErrorBodyData, required)
- `message` (string, required)

### pre-encounterPeriod

- `start` (date, optional, nullable)
- `end` (date, optional, nullable)

### pre-encounterAdditionalPayerInformation

- `availity_eligibility_id` (string, optional, nullable)
- `availity_payer_id` (string, optional, nullable)
- `availity_payer_name` (string, optional, nullable)
- `availity_remittance_payer_id` (string, optional, nullable)

### pre-encounterCanonicalClinicalTrialAssociation

- `id` (string, required) — The unique identifier for a clinical trial configured in the Taiga system
- `clinical_trial_arm` (string, optional, nullable)
- `period` (pre-encounterPeriod, optional, nullable)

### pre-encounterErrorBase4xx

- `message` (string, required)
- `data` (any, optional, nullable)

### pre-encounterVersionConflictErrorBody

- `message` (string, required)
- `data` (any, optional, nullable)
- `latest_version` (integer, optional, nullable)

### PatientDuplicateConflictErrorBodyData

- `potentialDuplicates` (list of PatientDuplicateConflictErrorBodyDataPotentialDuplicatesItems, required)

### PatientDuplicateConflictErrorBodyDataPotentialDuplicatesItems

- `existingPatientId` (string, required)
- `existingPatientMrn` (string, required)

## Examples

**Request**

```json
{
  "biological_sex": "FEMALE",
  "birth_date": "2023-01-15",
  "contacts": [
    {
      "relationship": [
        "SELF"
      ],
      "name": {
        "family": "string",
        "given": [
          "string"
        ],
        "use": "USUAL"
      },
      "telecoms": [
        {
          "value": "string",
          "use": "HOME"
        }
      ],
      "addresses": [
        {
          "use": "HOME",
          "line": [
            "string"
          ],
          "city": "string",
          "state": "string",
          "postal_code": "string",
          "country": "string"
        }
      ]
    }
  ],
  "filing_order": {
    "coverages": [
      "string"
    ]
  },
  "general_practitioners": [
    {
      "name": {
        "family": "string",
        "given": [
          "string"
        ],
        "use": "USUAL"
      },
      "telecoms": [
        {
          "value": "string",
          "use": "HOME"
        }
      ]
    }
  ],
  "mrn": "string",
  "name": {
    "family": "string",
    "given": [
      "string"
    ],
    "use": "USUAL"
  },
  "other_addresses": [
    {
      "use": "HOME",
      "line": [
        "string"
      ],
      "city": "string",
      "state": "string",
      "postal_code": "string",
      "country": "string"
    }
  ],
  "other_names": [
    {
      "family": "string",
      "given": [
        "string"
      ],
      "use": "USUAL"
    }
  ],
  "other_telecoms": [
    {
      "value": "string",
      "use": "HOME"
    }
  ],
  "primary_address": {
    "use": "HOME",
    "line": [
      "string"
    ],
    "city": "string",
    "state": "string",
    "postal_code": "string",
    "country": "string"
  }
}
```

**Response**

```json
{
  "biological_sex": "FEMALE",
  "birth_date": "2023-01-15",
  "contacts": [
    {
      "relationship": [
        "SELF"
      ],
      "name": {
        "family": "string",
        "given": [
          "string"
        ],
        "use": "USUAL",
        "period": {
          "start": "2023-01-15",
          "end": "2023-01-15"
        },
        "suffix": "string"
      },
      "telecoms": [
        {
          "value": "string",
          "use": "HOME",
          "period": {
            "start": "2023-01-15",
            "end": "2023-01-15"
          }
        }
      ],
      "addresses": [
        {
          "use": "HOME",
          "line": [
            "string"
          ],
          "city": "string",
          "state": "string",
          "postal_code": "string",
          "country": "string",
          "administrative_area": "string",
          "county": "string",
          "period": {
            "start": "2023-01-15",
            "end": "2023-01-15"
          }
        }
      ],
      "period": {
        "start": "2023-01-15",
        "end": "2023-01-15"
      },
      "hipaa_authorization": true
    }
  ],
  "deactivated": true,
  "filing_order": {
    "coverages": [
      "string"
    ]
  },
  "general_practitioners": [
    {
      "name": {
        "family": "string",
        "given": [
          "string"
        ],
        "use": "USUAL",
        "period": {
          "start": "2023-01-15",
          "end": "2023-01-15"
        },
        "suffix": "string"
      },
      "telecoms": [
        {
          "value": "string",
          "use": "HOME",
          "period": {
            "start": "2023-01-15",
            "end": "2023-01-15"
          }
        }
      ],
      "type": "PRIMARY",
      "npi": "string",
      "addresses": [
        {
          "use": "HOME",
          "line": [
            "string"
          ],
          "city": "string",
          "state": "string",
          "postal_code": "string",
          "country": "string",
          "administrative_area": "string",
          "county": "string",
          "period": {
            "start": "2023-01-15",
            "end": "2023-01-15"
          }
        }
      ],
      "period": {
        "start": "2023-01-15",
        "end": "2023-01-15"
      },
      "canonical_id": "string",
      "fax": "string",
      "other_fax_numbers": [
        "string"
      ],
      "emails": [
        "string"
      ],
      "service_facilities": [
        {
          "service_facility_id": "string"
        }
      ]
    }
  ],
  "id": "string",
  "mrn": "string",
  "name": {
    "family": "string",
    "given": [
      "string"
    ],
    "use": "USUAL",
    "period": {
      "start": "2023-01-15",
      "end": "2023-01-15"
    },
    "suffix": "string"
  },
  "organization_id": "string",
  "other_addresses": [
    {
      "use": "HOME",
      "line": [
        "string"
      ],
      "city": "string",
      "state": "string",
      "postal_code": "string",
      "country": "string",
      "administrative_area": "string",
      "county": "string",
      "period": {
        "start": "2023-01-15",
        "end": "2023-01-15"
      }
    }
  ],
  "other_names": [
    {
      "family": "string",
      "given": [
        "string"
      ],
      "use": "USUAL",
      "period": {
        "start": "2023-01-15",
        "end": "2023-01-15"
      },
      "suffix": "string"
    }
  ],
  "other_telecoms": [
    {
      "value": "string",
      "use": "HOME",
      "period": {
        "start": "2023-01-15",
        "end": "2023-01-15"
      }
    }
  ],
  "primary_address": {
    "use": "HOME",
    "line": [
      "string"
    ],
    "city": "string",
    "state": "string",
    "postal_code": "string",
    "country": "string",
    "administrative_area": "string",
    "county": "string",
    "period": {
      "start": "2023-01-15",
      "end": "2023-01-15"
    }
  },
  "updated_at": "2024-01-15T09:30:00Z",
  "updating_user_id": "string",
  "version": 1,
  "advanced_directives": [
    "NONE"
  ],
  "authorizations": [
    {
      "payer_id": "string",
      "payer_name": "string",
      "authorization_number": "string",
      "cpt_code": "string",
      "units": "VISIT",
      "additional_payer_information": {
        "availity_eligibility_id": "string",
        "availity_payer_id": "string",
        "availity_payer_name": "string",
        "availity_remittance_payer_id": "string"
      },
      "apply_for_all_cpt_codes": true,
      "no_prior_authorization_required": true,
      "quantity": 1,
      "period": {
        "start": "2023-01-15",
        "end": "2023-01-15"
      },
      "notes": "string",
      "billing_provider_npi": "string",
      "service_facility": {
        "service_facility_id": "string"
      },
      "dx_codes": [
        "string"
      ]
    }
  ],
  "coverages_for_related_causes": {
    "coverages": [
      "string"
    ]
  },
  "custom_metadata": [
    {
      "metadata_schema_id": "string",
      "key_value_pairs": {}
    }
  ],
  "deceased": "2024-01-15T09:30:00Z",
  "disability_status": "DISABLED",
  "do_not_invoice_reason": "BANKRUPTCY",
  "electronic_communication_consent": {
    "text_communication_consent": true,
    "email_communication_consent": true
  },
  "email": "string",
  "ethnicity": "HISPANIC_OR_LATINO",
  "external_provenance": {
    "external_id": "string",
    "system_name": "string"
  },
  "gender": "MAN",
  "guarantor": {
    "name": {
      "family": "string",
      "given": [
        "string"
      ],
      "use": "USUAL",
      "period": {
        "start": "2023-01-15",
        "end": "2023-01-15"
      },
      "suffix": "string"
    },
    "address": {
      "use": "HOME",
      "line": [
        "string"
      ],
      "city": "string",
      "state": "string",
      "postal_code": "string",
      "country": "string",
      "administrative_area": "string",
      "county": "string",
      "period": {
        "start": "2023-01-15",
        "end": "2023-01-15"
      }
    },
    "telecom": {
      "value": "string",
      "use": "HOME",
      "period": {
        "start": "2023-01-15",
        "end": "2023-01-15"
      }
    },
    "email": "string",
    "birth_date": "2023-01-15"
  },
  "hipaa_code": "string",
  "inferred_patient_metadata": {
    "inferred_encounter_id": "string",
    "inferred_encounter_latest_date_of_service": "2023-01-15"
  },
  "language": "string",
  "marital_status": "ANNULLED",
  "multiple_birth": 1,
  "non_insurance_payer_associations": [
    {
      "id": "string",
      "member_id": "string",
      "period": {
        "start": "2023-01-15",
        "end": "2023-01-15"
      },
      "clinical_trial_info": [
        {
          "id": "string",
          "clinical_trial_arm": "string",
          "period": {
            "start": "2023-01-15",
            "end": "2023-01-15"
          }
        }
      ]
    }
  ],
  "note_ids": [
    "string"
  ],
  "orcon": true,
  "origination_detail": {
    "referral_source": "HOSPITAL",
    "referring_provider": {
      "name": {
        "family": "string",
        "given": [
          "string"
        ],
        "use": "USUAL",
        "period": {
          "start": "2023-01-15",
          "end": "2023-01-15"
        },
        "suffix": "string"
      },
      "telecoms": [
        {
          "value": "string",
          "use": "HOME",
          "period": {
            "start": "2023-01-15",
            "end": "2023-01-15"
          }
        }
      ],
      "type": "PRIMARY",
      "npi": "string",
      "addresses": [
        {
          "use": "HOME",
          "line": [
            "string"
          ],
          "city": "string",
          "state": "string",
          "postal_code": "string",
          "country": "string",
          "administrative_area": "string",
          "county": "string",
          "period": {
            "start": "2023-01-15",
            "end": "2023-01-15"
          }
        }
      ],
      "period": {
        "start": "2023-01-15",
        "end": "2023-01-15"
      },
      "canonical_id": "string",
      "fax": "string",
      "other_fax_numbers": [
        "string"
      ],
      "emails": [
        "string"
      ],
      "service_facilities": [
        {
          "service_facility_id": "string"
        }
      ]
    },
    "specialization_categories": [
      "BEHAVIORAL_HEALTH_THERAPY"
    ],
    "referral_type": "DIRECTED"
  },
  "other_identifiers": [
    {
      "value": "string",
      "system": "string",
      "period": {
        "start": "2023-01-15",
        "end": "2023-01-15"
      }
    }
  ],
  "photo": "string",
  "primary_service_facility_id": "string",
  "primary_telecom": {
    "value": "string",
    "use": "HOME",
    "period": {
      "start": "2023-01-15",
      "end": "2023-01-15"
    }
  },
  "pronouns": [
    "string"
  ],
  "race": "AMERICAN_INDIAN_OR_ALASKA_NATIVE",
  "referrals": [
    {
      "provider": {
        "name": {
          "family": "string",
          "given": [
            "string"
          ],
          "use": "USUAL",
          "period": {
            "start": "2023-01-15",
            "end": "2023-01-15"
          },
          "suffix": "string"
        },
        "telecoms": [
          {
            "value": "string",
            "use": "HOME",
            "period": {
              "start": "2023-01-15",
              "end": "2023-01-15"
            }
          }
        ],
        "type": "PRIMARY",
        "npi": "string",
        "addresses": [
          {
            "use": "HOME",
            "line": [
              "string"
            ],
            "city": "string",
            "state": "string",
            "postal_code": "string",
            "country": "string",
            "administrative_area": "string",
            "county": "string",
            "period": {
              "start": "2023-01-15",
              "end": "2023-01-15"
            }
          }
        ],
        "period": {
          "start": "2023-01-15",
          "end": "2023-01-15"
        },
        "canonical_id": "string",
        "fax": "string",
        "other_fax_numbers": [
          "string"
        ],
        "emails": [
          "string"
        ],
        "service_facilities": [
          {
            "service_facility_id": "string"
          }
        ]
      },
      "referral_number": "string",
      "period": {
        "start": "2023-01-15",
        "end": "2023-01-15"
      },
      "notes": "string",
      "serviceFacility": {
        "service_facility_id": "string"
      },
      "units": "VISIT",
      "quantity": 1,
      "cptCodes": [
        "string"
      ],
      "applyForAllCptCodes": true
    }
  ],
  "self_pay": true,
  "service_facilities": [
    {
      "service_facility_id": "string"
    }
  ],
  "sexual_orientation": "HETEROSEXUAL",
  "social_security_number": "string",
  "tag_ids": [
    "string"
  ],
  "electronic_communication_opt_in": true,
  "non_insurance_payers": [
    "string"
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.taigabilling.com/patients/v1/with_mrn"

payload = {
    "biological_sex": "FEMALE",
    "birth_date": "2023-01-15",
    "contacts": [
        {
            "relationship": ["SELF"],
            "name": {
                "family": "string",
                "given": ["string"],
                "use": "USUAL"
            },
            "telecoms": [
                {
                    "value": "string",
                    "use": "HOME"
                }
            ],
            "addresses": [
                {
                    "use": "HOME",
                    "line": ["string"],
                    "city": "string",
                    "state": "string",
                    "postal_code": "string",
                    "country": "string"
                }
            ]
        }
    ],
    "filing_order": { "coverages": ["string"] },
    "general_practitioners": [
        {
            "name": {
                "family": "string",
                "given": ["string"],
                "use": "USUAL"
            },
            "telecoms": [
                {
                    "value": "string",
                    "use": "HOME"
                }
            ]
        }
    ],
    "mrn": "string",
    "name": {
        "family": "string",
        "given": ["string"],
        "use": "USUAL"
    },
    "other_addresses": [
        {
            "use": "HOME",
            "line": ["string"],
            "city": "string",
            "state": "string",
            "postal_code": "string",
            "country": "string"
        }
    ],
    "other_names": [
        {
            "family": "string",
            "given": ["string"],
            "use": "USUAL"
        }
    ],
    "other_telecoms": [
        {
            "value": "string",
            "use": "HOME"
        }
    ],
    "primary_address": {
        "use": "HOME",
        "line": ["string"],
        "city": "string",
        "state": "string",
        "postal_code": "string",
        "country": "string"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```