UpdatePortalVisitType
Update Portal Visit Type.
Call example:
string result = SageBridgeAPI.executeAPICall(
"cf389659-588c-4fd9-ab9e-7c37b438905c", // security token
"UpdatePortalVisitType",
"bos5", // practice Path or Tax ID
"JSON", // output format (XML or JSON)
"--request parameters XML or JSON---" // request parameters
);
This function can be used for:
- #1 - update visitTypeName for a given visitTypeId.
- #2 - update one or more existing appointment types.
- #3 - add new appointment types into existing visit type.
- Any combination of #1, #2, #3
Notes:
- Positive visitTypeId value is required.
- Any of appointmentType items with provided variationId value will be updated (scenario #2).
- Any of appointmentType items without variationId value will be created and added into visit type (scenario #3).
- Provide variationId value for appointment types to update. Otherwise it will create a new appointment type(s) without checking for duplicates.
Request parameters:
Request parameters are based on PortalVisitType element. It may have different set of fields depends on needs. See examples below.
JSON string request example:
Update visitTypeName only
{
"visitTypeId": 6475,
"visitTypeName": "TEST Visit Type",
"appointmentTypes": []
}
JSON string request example:
- Update visitTypeName b/c visitTypeName value is provided. Do not include visitTypeName if you don't want to modify it.
- Update AppointmentType with variationID = 5318.
- Add new AppointmentType with apptTypeId = 'NEWAT5' into visit type.
{
"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"
},
{
"apptTypeId": "NEWAT5",
"description": "NEW APPT TYPE-5 ",
"abbreviation": "NATEST5",
"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"
}
]
}
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