If you're following these articles sequentially and building the system from scratch, there are two paths to make the system start creating its own objects.
Path 1: Get distracted and meticulously define every realm, class, family, type as you need them. This approach may expose you to several concepts in quick succession, potentially causing information overload.
Path 2: Slowly introduce these concepts using UNKNOWN, UNASSIGNED, NOT APPLICABLE concepts.
I'm opting for Path 1 to gradually introduce concepts to you.
Let's begin by defining a few key terms:
This specific layer of abstraction is unncessary (RCFT)
Indicates that a classifier (Realm, Class, Family, Type) has not been assigned at this layer of abstraction (RCFT)
Implies that the classifier at this layer of abstraction (RCFT) is not known.
This distinction is vital, especially for automated processes. UNASSIGNED suggests the need for an eventual assignment process, which may involve creating new Realm, Class, Family, and/or Type (RCFT) and then updating the base record. On the other hand, UNKNOWN means that it has gone through the assignment process and remains truly unknown. Programmatically, this distinction helps avoid processing records that lack a clear abstraction. For instance, when instructing the system to process all 'OUTPATIENT' records, it will focus on those records only.
Taking this approach allows for a more gradual understanding of the system's intricacies and facilitates smoother learning without overwhelming you with too much information at once.
When we iterate through subjects (to create them), this will be a piece of code we use. A subject might be DataSet. Creating a subject would then create the RCFT Base for DataSet, and fill the RCFT with UNASSIGNED/UNKNOWN/NOT APPLICABLE.
1
2
3def rcft_initialization(_conn, _obj):
4 scr_realm = "INSERT INTO tbl_<<NAME>>_realm(sysgroupid_tenant,intcluster, strname, strkeyname, flgactive, flgtrusted) VALUES (1,1,'UNASSIGNED','UNASSIGNED',true,true);"
5 scr_class = "INSERT INTO tbl_<<NAME>>_class(sysgroupid_tenant,sys<<NAME>>_realmid, strname, strkeyname, flgactive, flgtrusted) VALUES (1,1,'UNASSIGNED','UNASSIGNED',true,true);"
6 scr_family = "INSERT INTO tbl_<<NAME>>_family(sysgroupid_tenant,sys<<NAME>>_classid, strname, strkeyname, flgactive, flgtrusted) VALUES (1,1,'UNASSIGNED','UNASSIGNED',true,true);"
7 scr_type = "INSERT INTO tbl_<<NAME>>_type(sysgroupid_tenant,sys<<NAME>>_familyid, strname, strkeyname, flgactive, flgtrusted) VALUES (1,1,'UNASSIGNED','UNASSIGNED',true,true);"
8
9 ex_realm = scr_realm.replace('<<NAME>>',_obj['name'].lower())
10 ex_class = scr_class.replace('<<NAME>>',_obj["name"].lower())
11 ex_family = scr_family.replace("<<NAME>>",_obj["name"].lower())
12 ex_type = scr_type.replace("<<NAME>>",_obj["name"].lower())
13 try:
14 cur = _conn.cursor()
15 cur.execute(ex_realm)
16 cur.execute(ex_class)
17 cur.execute(ex_family)
18 cur.execute(ex_type)
19 _conn.commit()
20 except Exception as e:
21 print(e)
22
23