Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A Clinic represents a healthcare facility, while Room is individual examination or treatment spaces within the clinic.

Load clinic or room from code

Load the Clinic or Room information based on the provided clinic code.

...

Parameter

Type

Description

clinicCode

String

The clinic code or room code provided by provider.

success

Closure

A closure called when the Clinic or Room information is successfully retrieved. Receives an optional Room object, an Account object, and a ClinicType enumeration as parameters. ClinicType can be clinic or room.

failure

Closure

A closure called when an error occurs during the API call. Receives an Error as a parameter.

Example Usage

Code Block
ClinicService.shared.loadClinicOrRoomByCode(clinicCode) { [weak self] room, account, type in
    // Handle successful loading of clinic or room data
    // Only retain the closure, remove internal logic
    
    // room: Room Data retrieved from server
    // account: Clinic Data retrieved from server
    // type: Can be room or clinic.
    success?(room, account, type)
} failure: { [weak self] error in
    // Handle failure and display error message
    // Only retain the closure, remove internal logic
    
    // Your comment here: Handle failure and display error message
    failure?()
}

Load clinic and room

Load Account and Room information based on the provided clinic code.

...

Parameter

Type

Description

clinicCode

String

The clinic code that provide by provider.

success

Closure

A closure called when the Account and Room information is successfully retrieved from VSeeClinicKit. Receives an Account object and an optional Room object as parameters.

failure

Closure

A closure called when an error occurs during the API call. Receives an Error as a parameter.

Example Usage

Code Block
ClinicService.shared.loadAccountAndRoom(roomcode, success: { account, room in
    // Handle successful loading of account and room data
}) { error in
    // Handle failure and display error message
}

Load clinic and list of rooms

Code Block
public func loadAccountAndListRoom(_ accountCode: String, 
                                    success: @escaping (Account?, [Room]?) -> Void, 
                                    failure: @escaping (Error) -> Void)

Parameter

Type

Description

accountCode

String

The clinic code that provide by provider.

success

Closure

A closure called when the Account information and the list of rooms are successfully retrieved. Receives an optional Account object and an optional array of Room objects as parameters.

failure

Closure

A closure called when an error occurs during the API call. Receives an Error as a parameter.

Load room information

Load the Room information based on the provided room code.

...

Parameter

Type

Description

roomCode

String

The room code that provide by provider.

success

Closure

A closure called when the Room is successfully retrieved. Receives a Room object as a parameter.

failure

Closure

A closure called when an error occurs during the API call. Receives an Error as a parameter.

Example Usage

Code Block
ClinicService.shared.loadRoomByCode(roomCode, success: {room in
    // Handle successful loading of the room
    // The `account` parameter contains the loaded account data
}, failure: { error in
    // Handle failure in loading the account
    // The `error` parameter represents the encountered error
})