An IndivoDocument represents a document tied to a record.
More...
#import <IndivoDocument.h>
Inherits IndivoAbstractDocument.
Inherited by IndivoAggregateReport, IndivoAllergy, IndivoAllergyExclusion, IndivoAppDocument, IndivoDemographics, IndivoEncounter, IndivoEquipment, IndivoFill, IndivoImmunization, IndivoLabResult, IndivoMedication, IndivoPrincipal, IndivoProblem, IndivoProcedure, IndivoSimpleClinicalNote, and IndivoVitalSigns.
An IndivoDocument represents a document tied to a record.
It's the superclass to all the specific document types we provide (IndivoMedication, IndivoAllergy and so on) and if you implement your own type, you should consider using this as the base class.
- (void) archive: |
|
(BOOL) |
flag |
forReason: |
|
(NSString *) |
aReason |
callback: |
|
(INCancelErrorBlock) |
callback |
|
|
| |
Archive (or unarchive) a document for the given reason.
You must supply a reason, Indivo server will issue a 400 if there is no reason
- Parameters
-
flag | YES to archive, NO to re-activate |
aReason | The reason for the status change, should not be nil if you want the call to succeed |
callback | An INCancelErrorBlock callback |
- (NSString *) basePostPath |
|
|
|
The base path, e.g.
"/records/{record id}/documents/" for documents. POSTing XML to this path should result in creation of a new object of this class (given it doesn't fail on the server)
- (id) cachedObjectOfType: |
|
(NSString *) |
aType |
|
Retrieves the object for a given type from cache.
Retrieves the cached object of a given type for a given document udid.
- Todo:
- load from disk
- (BOOL) cacheObject: |
|
(id) |
anObject |
asType: |
|
(NSString *) |
aType |
error: |
|
(__autoreleasing NSError **) |
error |
|
|
| |
Caches the object for a given type.
+ (BOOL) cacheObject: |
|
(id) |
anObject |
asType: |
|
(NSString *) |
aType |
forId: |
|
(NSString *) |
aUdid |
error: |
|
(__autoreleasing NSError **) |
error |
|
|
| |
Stores an object of a given type for the document of the given udid.
- Todo:
- cache to disk
+ (Class) documentClassForType: |
|
(NSString *) |
aType |
|
Returns the class for a previously registered type, or "IndivoDocument" if the type has not been registered.
- (NSString *) documentPath |
|
|
|
The path to this document, i.e.
the path I can GET to receive this document instance
- (void) fetchMetaDocumentWithCallback: |
|
(INSuccessRetvalueBlock) |
callback |
|
Fetches the meta document for this document.
+ (NSString *) fetchReportPathForRecord: |
|
(IndivoRecord *) |
aRecord |
|
The base path to get reports for documents of this class.
- (void) fetchStatusHistoryWithCallback: |
|
(INSuccessRetvalueBlock) |
callback |
|
Fetch the document's version history.
Upon success, the userInfo dictionary will contain an array of INDocumentStatusNode objects for the INResponesArrayKey key.
- Parameters
-
callback | An INCancelErrorBlock callback |
- (void) fetchVersionsWithCallback: |
|
(INSuccessRetvalueBlock) |
callback |
|
Fetch the document's version history.
Upon success, the userInfo dictionary will contain an array of IndivoMetaDocument objects for the INResponesArrayKey key.
- Parameters
-
callback | An INCancelErrorBlock callback |
- (BOOL) hasStatus: |
|
(INDocumentStatus) |
aStatus |
|
- Returns
- YES if the receiver's status matches the supplied status, which can be an OR-ed list of status
The designated initializer.
- Returns
- YES if this document has not (yet) been replaced by a newer version
- (void) pull: |
|
(INCancelErrorBlock) |
callback |
|
- (void) push: |
|
(INCancelErrorBlock) |
callback |
|
This method puts a new document on the server.
- Attention
- If you have assigned a udid yourself already, this udid will change. Use "replace:" to update a modified document on the server.
+ (void) registerDocumentClass: |
|
(Class) |
aClass |
|
Our IndivoDocument subclasses call this in their +load method.
Since we are auto-generating the classes from a template, this method is potentially also called by non-IndivoDocument-subclasses, which is why we check for subclass status here instead.
- (void) replace: |
|
(INCancelErrorBlock) |
callback |
|
This method updates the receiver's version on the server with new data from the receiver's properties.
If the document does not yet exist, this method automatically calls "push:" to create the document.
+ (NSString *) reportType |
|
|
|
This name is used to construct the report path for this kind of document.
For example, "IndivoMedication" will return "medications" from this method, so the path will be "/records/<record-id>/medications/".
- (void) setLabel: |
|
(NSString *) |
aLabel |
callback: |
|
(INCancelErrorBlock) |
callback |
|
|
| |
This method updates our udid, type and status from the given meta document.
- Todo:
- There is more information in the meta doc, either store the whole meta doc or store the data in the instance.
- (void) void: |
|
(BOOL) |
flag |
forReason: |
|
(NSString *) |
aReason |
callback: |
|
(INCancelErrorBlock) |
callback |
|
|
| |
Void (or unvoid) a document for a given reason.
- Parameters
-
flag | YES to void, NO to re-activate |
aReason | The reason for the status change, should not be nil if you want the call to succeed |
callback | An INCancelErrorBlock callback |
The creator of the document.
- (INDocumentStatus) documentStatus |
|
readnonatomicassign |
YES if the document has been fetched from the server.
The udid of the latest document of the receiver.
- (NSString*) uuidOriginal |
|
readnonatomiccopy |
The udid of the original document, if the receiver replaced a document.
- (NSString*) uuidReplaces |
|
readnonatomiccopy |
The udid of the replaced document, if the receiver replaced a document.
The documentation for this class was generated from the following files:
- IndivoFramework/Classes/IndivoDocument.h
- IndivoFramework/Classes/IndivoDocument.m