CreatePortalVisitType
Create new Portal Visit Type.
Call example:
string result = SageBridgeAPI.executeAPICall(
"cf389659-588c-4fd9-ab9e-7c37b438905c", // security token
"CreatePortalVisitType",
"bos5", // practice Path or Tax ID
"JSON", // output format (XML or JSON)
"--request parameters XML or JSON---" // request parameters
);
Request parameters:
PortalVisitType element
| Name |
Type |
Size |
Desciption |
| visitTypeName | (string) | 50 | Visit Type name/category. |
| [appointmentTypes] | (array) | | Represents a list of appointment types as used in PM/EMR system. |
| appointmentType.apptTypeId | (string) | 50 | Appointment type identifier as defined in PM/EMR system. Use this value to book an appointment or check appointment type. (required). |
| appointmentType.description | (string) | 150 | Visit Type name as used in practice. |
| appointmentType.abbreviation | (string) | 10 | Visit Type abbreviation. (optional) (some practices use abbreviation instead of visitTypeId to book appointments). |
| appointmentType.duration | (integer) | | Default duration of given visit type. |
| appointmentType.problemOkFlag | (string) | | Problem OK flag (0/1 or N/Y or false/true). |
| appointmentType.newPatientsFlag | (string) | | New Patients flag (0/1 or N/Y or false/true). |
| appointmentType.refreactionNeededFlag | (string) | | Refraction Needed flag (0/1 or N/Y or false/true). |
| appointmentType.filterFlag | (string) | | (0/1 or N/Y or false/true). |
| appointmentType.appointmentRequestFlag | (string) | | (0/1 or N/Y or false/true). |
| appointmentType.quickAppointmentFlag | (string) | | (0/1 or N/Y or false/true). |
| appointmentType.videoVisitFlag | (string) | | (0/1 or N/Y or false/true). |
| appointmentType.inputNewPatientFlag | (string) | | (0/1 or N/Y or false/true). |
| appointmentType.inputProblemFlag | (string) | | (0/1 or N/Y or false/true). |
| appointmentType.inputRefractionFlag | (string) | | (0/1 or N/Y or false/true). |
| appointmentType.techNeededMinutes | (int) | | Technician duration, if needed. Empty if no technician needed. |
| appointmentType.techNeededFlag | (string) | | (0/1 or N/Y or false/true). |
Notes:
- At least one appointmentType item must be presented in a request.
- Request may have more than one appointmentType items.
- Request can be presented in a "plain" form, see example below.
JSON request example:
{
"visitTypeName": "TEST New Visit",
"appointmentTypes": [
{
"apptTypeId": "NEWAT2",
"description": "NEW APPT TYPE -2 ",
"abbreviation": "NATEST2",
"duration": null,
"problemOkFlag": "false",
"newPatientsFlag": "false",
"refractionNeededFlag": "false",
"filterFlag": "false",
"appointmentRequestFlag": "false",
"quickAppointmentFlag": "false",
"videoVisitFlag": "1",
"inputNewPatientFlag": "false",
"inputProblemFlag": "false",
"inputRefractionFlag": "false",
"techNeededMinutes": "10",
"techNeededFlag": "yes"
}
]
}
XML request example:
JSON request example (plain format):
{
"visitTypeName": "TEST New Visit",
"apptTypeId": "NEWAT1",
"description": "NEW APPT TYPE-1",
"abbreviation": "NATEST1",
"duration": "15",
"problemOkFlag": null,
"newPatientsFlag": null,
"refractionNeededFlag": null,
"filterFlag": null,
"appointmentRequestFlag": null,
"quickAppointmentFlag": null,
"videoVisitFlag": null,
"inputNewPatientFlag": null,
"inputProblemFlag": null,
"inputRefractionFlag": null,
"techNeededMinutes": null,
"techNeededFlag": null
}
XML request example (plain format):
Response:
XML or JSON string representing APIResponse structure.
APIResponse payload element may be encrypted and delivered as Base64 string.
Response data:
| Name |
Type |
Desciption |
| code | (string) | 0 - operation successfull. Otherwise see description and validation data. |
| description | (string) | Result Descriptions |
| validation | (array) | List of validation errors. |
| validation.id | (string) | Error/Validation code. See possible validation codes below. |
| validation.display | (string) | Error description. |
Notes:
- Response data will have visitType data if request executed without errors.
- See validation codes if request faield.
Example of JSON payload (success):
{
"code": "0",
"description": "New Visit Type created successfuly",
"lang": "en",
"validation": null,
"visitType": {
"visitTypeId": 6475,
"visitTypeName": "TEST New Visit",
"appointmentTypes": [
{
"variationId": 5318,
"apptTypeId": "NEWAT2",
"description": "NEW APPT TYPE -2",
"abbreviation": "NATEST2",
"duration": "",
"problemOkFlag": "false",
"newPatientsFlag": "false",
"refractionNeededFlag": "false",
"filterFlag": "false",
"appointmentRequestFlag": "false",
"quickAppointmentFlag": "false",
"videoVisitFlag": "true",
"inputNewPatientFlag": "false",
"inputProblemFlag": "false",
"inputRefractionFlag": "false",
"techNeededMinutes": "0",
"techNeededFlag": "true"
}
]
}
}
Example of JSON payload (failed):
{
"visitType": null,
"code": "-1",
"description": "Request failed. See validation messages",
"lang": "en",
"validation": [
{
"id": "350",
"display": "Visit Type \u0027TEST New Visit\u0027 already exists"
}
]
}
Example of XML payload (success):
Example of XML payload (failed):
Possible return codes
- 0 - Success. Description may vary by function
- -1 - General error. Description attribute will show more details about an error
- -2 - Function is not supported
- 500 - Invalid credentials provided
- 501 - License is expired
- 502 - License is not active
- 503 - Token is not active or expired
- 550 - Unknow functionName or not subscribed
- 551 - Unknown practice
- 552 - No Subscription found
- 553 - Subscription is inactive or expired
- 600 - Invalid or empty request parameters
- 601 - No valid route found for this subscription
- 602 - Unable to parse request parameters
This function may return other codes not listed above; they may vary by practice.
Validation codes:
- 350 - Visit Type already exists
- 351 - Visit Type not found
- 352 - Appointment Type Id is required
- 353 - Appointment Type Description is required
Known Issues:
None
See Also:
API Functions,
APIResponse structure