Indivo Framework (iOS)
An iOS framework for Apps connecting to Indivo server
|
#import <IndivoRecord.h>
Inherits INServerObject.
Instance Methods | |
(IndivoDocument *) | - addDocumentOfClass:error: |
Instantiates a document of given class and adds it to our documents cache. More... | |
(void) | - fetchAppSpecificDocumentsWithCallback: |
Fetch app specific documents of the receiver, calling GET on /records/{record id}/apps/{app id}/documents/. More... | |
(void) | - fetchDemographicsDocumentWithCallback: |
Fetches the record's demographics document. More... | |
(void) | - fetchDocumentsOfClass:callback: |
Fetch documents of a given type, calling GET on /records/{record id}/documents/?type={type}. More... | |
(void) | - fetchDocumentsWithCallback: |
Fetch all documents of the receiver, calling GET on /records/{record id}/documents/. More... | |
(void) | - fetchRecordInfoWithCallback: |
Fetches basic record info. More... | |
(void) | - fetchReportsOfClass:callback: |
Fetches reports of given type from the server. More... | |
(void) | - fetchReportsOfClass:withQuery:callback: |
Fetches reports limited by the query parameters given. More... | |
(id) | - initWithId:onServer: |
Initializes a record from given parameters. More... | |
(void) | - sendMessage:withBody:ofType:severity:attachments:callback: |
Posts a message to the record's inbox. More... | |
(void) | - sendMessage:withBody:ofType:severity:attachments:messageId:callback: |
Posts a message to the record's inbox. More... | |
![]() | |
(void) | - forceNotOnServer |
This is provided for subclasses, the fact that onServer is readonly but settable by this and markOnServer underlines the fact that you should only change this property when you know what you're doing. More... | |
(void) | - get:callback: |
Shortcut for GETting data. More... | |
(void) | - get:parameters:callback: |
Shortcut for GETting data with parameters. More... | |
(id) | - initFromNode:withServer: |
The designated initializer. More... | |
(BOOL) | - is: |
Shortcut method to test if the document has the given ID. More... | |
(void) | - markOnServer |
Sets onServer to YES for the receiver. More... | |
(void) | - performMethod:withBody:orParameters:httpMethod:callback: |
The basic method to perform REST methods on the server with App credentials. More... | |
(void) | - post:body:callback: |
Shortcut for POSTing body data. More... | |
(void) | - post:parameters:callback: |
Shortcut for POSTing parameters. More... | |
(void) | - put:body:callback: |
Shortcut for PUTting data. More... | |
Properties | |
NSString * | accessToken |
The last access token successfully used with this record. More... | |
NSString * | accessTokenSecret |
The last access token secret successfully used with this record. More... | |
NSDate * | created |
When this record has been created on the server. More... | |
IndivoDemographics * | demographicsDoc |
The demographics document for this record. More... | |
NSString * | demographicsDocId |
The id of the demographics document. More... | |
NSString * | label |
This record's name. More... | |
![]() | |
BOOL | onServer |
Indicates whether this document lives on the server. More... | |
IndivoServer * | server |
Our beloved server. More... | |
NSString * | uuid |
This object's udid. More... | |
Additional Inherited Members | |
![]() | |
(NSArray *) | + attributeNames |
The properties whose names are returned here are expected to be XML node attributes rather than complete nodes. More... | |
(NSString *) | + flatXMLNameForPropertyName: |
Objects have the ability to use a different name from the property name for flat XML "name" attributes. More... | |
(id) | + newWithNodeName: |
Returns a fresh node with nodeName set. More... | |
(NSString *) | + nodeName |
(NSString *) | + nodeType |
(id) | + objectFromAttribute:inNode: |
This method returns an object created from the string contents of a node attribute. More... | |
(id) | + objectFromNode: |
This method returns an object created representing the the node. More... | |
![]() | |
NSString * | _nodeName |
- (IndivoDocument *) addDocumentOfClass: | (Class) | documentClass | |
error: | (NSError * __autoreleasing *) | error | |
Instantiates a document of given class and adds it to our documents cache.
documentClass | Must be a subclass of IndivoDocument |
error | An error pointer |
- (void) fetchAppSpecificDocumentsWithCallback: | (INSuccessRetvalueBlock) | callback |
Fetch app specific documents of the receiver, calling GET on /records/{record id}/apps/{app id}/documents/.
Upon callback, the "INResponseArrayKey" of the user-info dictionary will contain IndivoAppDocument instances.
- (void) fetchDemographicsDocumentWithCallback: | (INCancelErrorBlock) | aCallback |
Fetches the record's demographics document.
Note that this call fetches the demographics document not from the "official" /records/id/demographics REST path but via its uuid from /records/id/documents/demographics-document-id. This is because the latter call returns the document in a different XML format, the one we need, because it is the same format required to PUT the document.
- (void) fetchDocumentsOfClass: | (Class) | documentClass | |
callback: | (INSuccessRetvalueBlock) | callback | |
Fetch documents of a given type, calling GET on /records/{record id}/documents/?type={type}.
Upon callback, the "INResponseArrayKey" of the user-info dictionary will contain IndivoMetaDocument instances for this record's documents.
documentClass | The class of the documents to fetch, must be an IndivoDocument subclass or it will be ignored |
callback | The callback block to be executed after the transfer finishes |
- (void) fetchDocumentsWithCallback: | (INSuccessRetvalueBlock) | callback |
Fetch all documents of the receiver, calling GET on /records/{record id}/documents/.
Upon callback, the "INResponseArrayKey" of the user-info dictionary will contain IndivoMetaDocument instances for this record's documents. This method will call "fetchDocumentsOfClass:callback:" with no class argument.
callback | The callback block to be executed after the transfer finishes |
- (void) fetchRecordInfoWithCallback: | (INCancelErrorBlock) | aCallback |
Fetches basic record info.
- (void) fetchReportsOfClass: | (Class) | documentClass | |
callback: | (INSuccessRetvalueBlock) | callback | |
Fetches reports of given type from the server.
- (void) fetchReportsOfClass: | (Class) | documentClass | |
withQuery: | (INQueryParameter *) | aQuery | |
callback: | (INSuccessRetvalueBlock) | callback | |
Fetches reports limited by the query parameters given.
documentClass | The class representing the desired document type (e.g. IndivoMedication for medication reports) |
aQuery | The query parameters restricting the query |
callback | The block to execute upon success or failure |
- (id) initWithId: | (NSString *) | anId | |
onServer: | (IndivoServer *) | aServer | |
Initializes a record from given parameters.
- (void) sendMessage: | (NSString *) | messageSubject | |
withBody: | (NSString *) | messageBody | |
ofType: | (INMessageType) | type | |
severity: | (INMessageSeverity) | severity | |
attachments: | (NSArray *) | attachments | |
callback: | (INCancelErrorBlock) | callback | |
Posts a message to the record's inbox.
This method auto-generates a message id, which generally is what you want. This method generates an API call POST /records/{RECORD_ID}/inbox/{MESSAGE_ID} with the given arguments. If attachments are supplied, the callback will only be called once all attachments have been uploaded.
messageSubject | The message subject |
messageBody | The message's body |
type | How to interpret the message body |
severity | The severity or priority of the message |
attachments | An array containing IndivoDocument instances. |
callback | The block to be called when the operation finishes. |
- (void) sendMessage: | (NSString *) | messageSubject | |
withBody: | (NSString *) | messageBody | |
ofType: | (INMessageType) | type | |
severity: | (INMessageSeverity) | severity | |
attachments: | (NSArray *) | attachments | |
messageId: | (NSString *) | messageId | |
callback: | (INCancelErrorBlock) | callback | |
Posts a message to the record's inbox.
This method generates an API call POST /records/{RECORD_ID}/inbox/{MESSAGE_ID} with the given arguments. If attachments are supplied, the callback will only be called once all attachments have been uploaded.
messageSubject | The message subject |
messageBody | The message's body |
type | How to interpret the message body |
severity | The severity or priority of the message |
attachments | An array containing IndivoDocument instances. |
messageId | A message id |
callback | The block to be called when the operation finishes. |
|
readwritenonatomiccopy |
The last access token successfully used with this record.
|
readwritenonatomiccopy |
The last access token secret successfully used with this record.
|
readnonatomicstrong |
When this record has been created on the server.
|
readnonatomicstrong |
The demographics document for this record.
|
readnonatomiccopy |
The id of the demographics document.
|
readwritenonatomiccopy |
This record's name.