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
# Assume that I have MyApp as a repository and my project root folder is also MyApp. | |
echo "Lets update the build number for featire releases" | |
echo "Creating temp folder as ~/Documents/TempCadenceIosBuildIncrement/" | |
mkdir ~/Documents/TempIosBuildIncrement/ | |
cd ~/Documents/TempIosBuildIncrement/ | |
echo "Cloning Repo of master branch....." | |
git clone https://gitlab.com/MyApp.git # clone your master branch here. | |
echo "Clonned successfully. Updating build number now using PlistBuddy" | |
cd MyApp/ # get into the project directory. |
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
// Make sure you import HealthKit | |
// Get the HKHealthStore reference. Must be single reference in your app. | |
let healthStore = HKHealthStore() | |
// Create required Record Type's equivalent HKClinicalType using clinicalType func of HKObjectType | |
guard let allergyRecord = HKObjectType.clinicalType(forIdentifier: .allergyRecord), | |
let medicationRecord = HKObjectType.clinicalType(forIdentifier: .medicationRecord), | |
let conditionRecord = HKObjectType.clinicalType(forIdentifier: .conditionRecord), |
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
func getRecordUsingPredicateForAllergyType(recordReadCompletionHandler:@escaping ([HKClinicalRecord]?) -> Void) { | |
guard let healthRecordAllergyType = HKObjectType.clinicalType(forIdentifier: .allergyRecord) else { | |
fatalError("*** Unable to create the Allergy type ***") | |
} | |
let healthRecordPredicate = HKQuery.predicateForClinicalRecords(withFHIRResourceType: .allergyIntolerance) | |
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
func getRecordForType(type: HKClinicalTypeIdentifier, recordReadCompletionHandler:@escaping ([HKClinicalRecord]?) -> Void) { | |
guard let healthRecordType = HKObjectType.clinicalType(forIdentifier: type) else { | |
fatalError("*** Unable to create the record type ***") | |
} | |
let healthRecordQuery = HKSampleQuery(sampleType: healthRecordType, predicate: nil, limit: HKObjectQueryNoLimit, sortDescriptors: nil) { (query, samples, error) in | |
guard let actualSamples = samples else { |
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
// MARK: Allergy | |
struct Reaction:Codable { | |
let onset:String? | |
let manifestation:[[String: String]] | |
let severity:String | |
} | |
struct Allergy: Codable { | |
let id: String |
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
// MARK: Condition | |
struct Condition:Codable { | |
let id: String | |
let resourceType:String | |
let asserter:Person | |
let category:[String: [[String: String]]] | |
let clinicalStatus: String | |
let code: CodeableConcept |
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
// MARK: Immunization | |
struct Immunization:Codable { | |
let id: String | |
let resourceType:String | |
let vaccineCode:CodeableConcept | |
let encounter:[String: String] | |
let requester:[String: String] | |
let date: String |
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
// MARK: LabResult | |
struct ReferenceRange:Codable { | |
let low:ValueQuantity | |
let high:ValueQuantity | |
let text:String | |
} | |
struct ValueQuantity:Codable { |
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
// MARK: Medication | |
struct DosageInstruction: Codable { | |
let text:String? | |
let timing:[String:[String:String?]?]? | |
} | |
struct Medication:Codable { | |
let dateWritten:String | |
let status: String |
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
// MARK: Procedure | |
struct Procedure:Codable { | |
let id: String | |
let resourceType:String | |
let code:CodeableConcept | |
let status:String | |
let encounter:[String: String] | |
let performedDateTime:String |
OlderNewer