-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from savannahghi/fetch-facilities
feat: fetch facilities
- Loading branch information
Showing
4 changed files
with
166 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,51 @@ | ||
package healthcrm | ||
|
||
import "time" | ||
|
||
// Facility is the hospitals model used to show facility details | ||
type FacilityOutput struct { | ||
ID string `json:"id"` | ||
Name string `json:"name"` | ||
Description string `json:"description"` | ||
FacilityType string `json:"facility_type"` | ||
County string `json:"county"` | ||
Country string `json:"country"` | ||
Address string `json:"address"` | ||
Coordinates CoordinatesOutput `json:"coordinates"` | ||
Contacts []Contacts `json:"contacts"` | ||
Identifiers []Identifiers `json:"identifiers"` | ||
BusinessHours []any `json:"businesshours"` | ||
type FacilityPage struct { | ||
Count int `json:"count"` | ||
Next string `json:"next"` | ||
Previous any `json:"previous"` | ||
PageSize int `json:"page_size"` | ||
CurrentPage int `json:"current_page"` | ||
TotalPages int `json:"total_pages"` | ||
StartIndex int `json:"start_index"` | ||
EndIndex int `json:"end_index"` | ||
Results []FacilityOutput `json:"results"` | ||
} | ||
|
||
// CoordinatesOutput is used to show the geographical's location data class of a facility | ||
type CoordinatesOutput struct { | ||
ID string `json:"id"` | ||
Latitude float64 `json:"latitude"` | ||
Longitude float64 `json:"longitude"` | ||
} | ||
type ContactsOutput struct { | ||
ID string `json:"id"` | ||
ContactType string `json:"contact_type"` | ||
ContactValue string `json:"contact_value"` | ||
Active bool `json:"active"` | ||
Role string `json:"role"` | ||
FacilityID string `json:"facility_id"` | ||
} | ||
type IdentifiersOutput struct { | ||
ID string `json:"id"` | ||
IdentifierType string `json:"identifier_type"` | ||
IdentifierValue string `json:"identifier_value"` | ||
ValidFrom string `json:"valid_from"` | ||
ValidTo string `json:"valid_to"` | ||
FacilityID string `json:"facility_id"` | ||
} | ||
type FacilityOutput struct { | ||
ID string `json:"id"` | ||
Created time.Time `json:"created"` | ||
Name string `json:"name"` | ||
Description string `json:"description"` | ||
FacilityType string `json:"facility_type"` | ||
County string `json:"county"` | ||
Country string `json:"country"` | ||
Coordinates CoordinatesOutput `json:"coordinates"` | ||
Status string `json:"status"` | ||
Address string `json:"address"` | ||
Contacts []ContactsOutput `json:"contacts"` | ||
Identifiers []IdentifiersOutput `json:"identifiers"` | ||
BusinessHours []any `json:"businesshours"` | ||
} |