# Test sandbox for onramp to TEFCA-CommonWell

The CommonWell sandbox within Redox is integrated with the CommonWell environment, which allows you a sneak peek into what querying TEFCA-CommonWell will be like. The sandbox is a <u>data on demand</u> repository where test data lives. [Learn more about data on demand](/basics/data-exchange-with-redox/data-on-demand).

## Redox test patients

In order to query the sandbox, you first have to ingest our test patients. This replicates the behavior of the CommonWell EMPI, which only returns matches for patients that already exist within your organization’s repository. In other words, results won’t be returned from external participants unless a demographics match already exists in your own CommonWell dataset. 

You can ingest these test patients with a `PatientAdmin` feed.  

<details>
<summary>Test patients for TEFCA-CommonWell</summary>

| **Patient name** | **Identifiers / Demographics** |
| --- | --- |
| Gerard Cremin | **SSN**: 999-86-7555 **DOB**: 1989-12-25 **gender**: male **address**: 273 Farrell Village, Madison, WI 53558 USA   **phone (home)**: 555-551-3549 **email**: Gerard.Cremin-20@syntheamail.com |
| Kelli Fritsch | **SSN**: 999-88-7393 **DOB**: 2007-01-01 **gender**: female **address**: 853 Schinner Ramp, Madison, WI 53703 USA   **phone (home)**: 555-140-2272  **phone (mobile)**: 555-503-2846 **email**: Kelli.Fritsch-80@syntheamail.com |
| Bobby Gottlieb | **SSN**: 999-42-4700 **DOB**: 2010-06-04 **gender**: male **address**: 930 Strosin Parade, Madison, WI 53718 USA   **phone (mobile)**: 555-887-6766 **email**: Bobby.Gottlieb-51@syntheamail.com |
| Calvin Hills | **SSN**: 999-81-6372 **DOB**: 1989-08-16 **gender**: male **address**: 765 Dickinson Annex Unit 1, Madison, WI 53714 USA **phone (mobile)**: 555-757-8394 **email**: Calvin.Hills-100@syntheamail.com |
| Harriet Dare | **SSN**: 999-38-8978 **DOB**: 1957-05-20 **gender**: female **address**: 554 Bechtelar Annex, Madison, WI 53715 USA   **phone (home)**: 555-726-3278  **phone (mobile)**: 555-925-1166 **email**: Harriet.Dare-44@syntheamail.com |
| lacy523 waelchi213 | **SSN**: 101-01-0001 **DOB**: 2014-05-19 **gender**: male **address**: 418 Rice Ranch Apartment 17 Easton, MA USA   **phone (home)**: +18088675301 |
| Timothy Hammes | **SSN**: 999-59-1387 **DOB**: 1913-12-15 **gender**: male **address**: 827 Kris Extension Suite 24, Madison, WI 53597 USA  **phone (home)**: 555-729-2695  **phone (mobile)**: 555-255-9511 **email**: Timothy.Hammes-22@syntheamail.com |
| Magdalene Kemmer | **SSN**: 999-11-4990 **DOB**: 2000-10-24 **gender**: female **address**: 444 Kunze Manor, Madison, WI 53714 USA **phone (home)**: 555-464-7884 **email**: Magdalene.Kemmer-49@syntheamail.com |
| Ashleigh Torp | **SSN**: 999-46-9721 **DOB**: 1964-09-16 **gender**: female **address**: 482 Larkin Blvd, Madison, WI 53590 USA **phone (home)**: 555-896-4339  **phone (mobile)**: 555-271-7887 **email**: Ashleigh.Torp-40@syntheamail.com |
| Arron Walsh | **SSN**: 999-27-8636 **DOB**: 1988-08-22 **gender**: male **address**: 600 Nolan Forge, Madison, WI 53590 USA **phone (home)**: 555-170-3036 **email**: Arron.Walsh-38@syntheamail.com |
| Agnes Schroeder | **SSN**: 999-85-9725 **DOB**: 1990-02-05 **gender**: female **address**: 304 Rogahn Run, Madison, WI USA **phone (mobile)**: 555-500-1569 **email**: Agnes.Schroeder-6@syntheamail.com |

</details>

> **FYI: Data from Synthea**
>
> We generated some of our test data from an open-source dataset called Synthea™. 
>
> > Jason Walonoski, Mark Kramer, Joseph Nichols, Andre Quina, Chris Moesel, Dylan Hall, Carlton Duffett, Kudakwashe Dube, Thomas Gallagher, Scott McLachlan, Synthea: An approach, method, and software mechanism for generating synthetic patients and the synthetic electronic health care record, _Journal of the American Medical Informatics Association_, Volume 25, Issue 3, March 2018, Pages 230–238, [https://doi.org/10.1093/jamia/ocx079](https://doi.org/10.1093/jamia/ocx079)

## Sandbox metadata

You’ll need both of these values in the metadata of your queries to the CommonWell sandbox.

| **Type** | **Value** |
| --- | --- |
| Sandbox organization ID (OID) | `2.16.840.1.113883.3.6147.450.0.2.19260.0.1` |
| Patient Identity Assigning Authority (PIAA) | `2.16.840.1.113883.3.6147.450.0.2.19260.0.2` |

> **Redox sandbox organization**
>
> For the quickest approach, use the Redox sandbox organization as the `sender-organization-id` in the query metadata. 
>
> If you want to see results in the development environment of your own Redox organization, you first have to ingest test patients into your organization. 

**Metadata for TEFCA-CommonWell sandbox requests**

```json
"Extensions": {
  "purpose-of-use": {
     "url": "https://api.redoxengine.com/extensions/purpose-of-use",
     "coding": {
       "code": "TREATMENT"
     }
  },
  "sender-organization-id": {
     "url": "https://api.redoxengine.com/extensions/sender-organization-id",
     "string": "2.16.840.1.113883.3.6147.450.0.2.19260.0.1"
  },
  "assigning-authority": {
     "url": "https://api.redoxengine.com/extensions/assigning-authority",
     "string": "2.16.840.1.113883.3.6147.450.0.2.19260.0.2"
  },
  "user-id": {
     "url": "https://api.redoxengine.com/extensions/user-id",
     "string": "redox-sandbox-tester"
  },
  "user-role": {
     "url": "https://api.redoxengine.com/extensions/user-role",
     "coding": {
       "code": "112247003",
       "display": "Medical Doctor"
     }
  }
},
```

## Use the TEFCA-CommonWell sandbox

1. [Create an API source](/how-to-use-redox/manage-your-redox-setup/set-up-sources) in your development environment to interface with the CommonWell network. 
2. Your Technical Account Manager creates:
   1. Your data on demand destination, which houses test patient data for you. They add a unique ID type that matches your CommonWell PIAA. [Learn about OIDs for CommonWell](/how-to-use-redox/interact-with-clinical-networks/onramp-to-tefca-commonwell/tefca-identity-and-organization-structure). 
   2. Your CommonWell DNPR.
   3. Subscriptions with the source you created in step 1. Each subscription includes your API source and one of these data models: 
      1. `PatientAdmin`


> **Ingesting patient data**
>
> This data model enables you to ingest test patient data into your system. Keep in mind that you can re-ingest Redox test patients using your own patient identifier, ID type, and `sender-organization-id`. 


      2. `PatientSearch`
      3. `ClinicalSummary`
      4. `Organization`
3. [Create a TEFCA-CommonWell organization record](/how-to-use-redox/interact-with-clinical-networks/onramp-to-tefca-commonwell/create-a-tefca-commonwell-organization-record) for the sandbox. 
   1. For the organization ID, use the directory OID from the data on demand DNPR your Technical Account Manager created for you in step 2. 
   2. For the ID type, use `PIAA`. 
   3. Set `"Test": true` to mark this as a sandbox organization record. This value should be false for `production` organizations.
   4. Replace the example values below with the source and destination IDs that were created in steps 1 and 2.


**Example: Create a development organization record**

```json
{
  "Meta": {
    "DataModel": "Organization",
    "EventType": "New",
    "EventDateTime": null,
    "Test": true,
    "Source": {
      "ID": "84fe7f6b-fe6a-48cf-a45b-ef2f195dbaaf",
      "Name": "cw-sender-source"
    },
    "Destinations": [
      {
        "ID": "3122bfff-f1fb-4fdf-97de-294f24338229",
        "Name": "CommonWell EMPI [Integration]"
      }
    ],
    "Logs": [
      {
        "ID": "0196f43b-9f99-7111-b4c6-5d2850b767bc",
        "AttemptID": "0196f43b-9f99-7b9b-bda6-bb3ec95dbaf4"
      }
    ],
    "FacilityCode": null
  },
  "Directory": "CommonWell",
  "Organizations": [
    {
      "Active": true,
      "Name": "{{your-organization-name}}",
      "Aliases": [],
      "Identifiers": [
        {
          "ID": "{{assigning-authority}}",
          "IDType": "PIAA"
        },
        {
          "ID": "{{organization-OID}}",
          "IDType": "OID"
        }
      ],
      "Type": {
        "System": "http://hl7.org/fhir/organization-type",
        "Value": "HOSPITAL"
      },
      "PartOf": {
        "Identifier": {
          "Type": "HCID",
          "System": "http://www.hl7.org/oid/",
          "Value": "1.2.3.4"
        }
      },
      "Contacts": [
        {
          "Purpose": null,
          "Name": "Bixby, Barbara",
          "EmailAddresses": [
            "barb.bixby@test.net"
          ],
          "PhoneNumber": {
            "Home": "+18088675303",
            "Work": null,
            "Mobile": "+19189368865"
          }
        }
      ],
      "Address": {
        "StreetAddress": "123 Main St.",
        "City": "ATown",
        "State": "AL",
        "ZIP": "86754",
        "County": "Madison",
        "Country": "USA"
      },
      "Endpoints": [
        {
          "Identifiers": [
            {
              "Type": "HCID",
              "System": "http://www.hl7.org/oid/",
              "Value": "2.8.1.2"
            }
          ],
          "ConnectionType": {
            "System": "http://hl7.org/fhir/subscription-channel-type",
            "Value": "ihe-xcpd"
          },
          "Name": "Patient Discovery",
          "Address": "https://fake.fake.com/xcpd",
          "MIMEType": "Text/XML",
          "Attributes": {
            "Transaction": "XCPD ITI-55",
            "Actor": {
              "System": "https://sequoiaproject.org/StructureDefinition/Endpoint/Actor/1.0.0",
              "Value": "Responding Gateway"
            },
            "Version": {
              "System": "https://sequoiaproject.org/StructureDefinition/Endpoint/Version/1.0.0",
              "Value": "2.0"
            },
            "UseCases": [
              {
                "System": "https://sequoiaproject.org/StructureDefinition/Endpoint/UseCases/1.0.0",
                "Value": "QueryBasedDocumentExchange"
              }
            ],
            "PurposeOfUse": [
              {
                "System": "https://sequoiaproject.org/StructureDefinition/Endpoint/PurposesOfUse/1.0.0",
                "Value": "Treatment"
              }
            ],
            "Roles": [
              {
                "System": "https://sequoiaproject.org/StructureDefinition/Endpoint/Roles/1.0.0",
                "Value": "All"
              }
            ]
          }
        }
      ],
      "DestinationID": "3122bfff-f1fb-4fdf-97de-294f24338229"
    }
  ]
}
```


4. Ingest Redox test patients with your `PatientAdmin` subscription. 
5. [Search for patient records](/how-to-use-redox/interact-with-clinical-networks/onramp-to-tefca-commonwell/search-tefca-commonwell-for-patient-records) in the TEFCA-CommonWell sandbox.

> **No real PHI**
>
> You shouldn’t include any real PHI in your development environment.
