Allow medical hud to add comment to medical record

Add a direct [Add comment] link in the examine text
Add a comment in the record comment list, signed with the current
authentication of the HUD wearer

Add a [View comments log] link in the medical record view from the
Medical Hud
This list all the comments as on the medical record computer
This commit is contained in:
jupotter
2013-04-08 14:12:57 +02:00
parent bd52b3de32
commit 4b9d14b564
2 changed files with 60 additions and 0 deletions

View File

@@ -440,6 +440,7 @@
msg += "<span class = 'deptradio'>Physical status:</span> <a href='?src=\ref[src];medical=1'>\[[medical]\]</a>\n"
msg += "<span class = 'deptradio'>Medical records:</span> <a href='?src=\ref[src];medrecord=`'>\[View\]</a>\n"
msg += "<span class = 'deptradio'>Medical records:</span> <a href='?src=\ref[src];medrecord=`'>\[View\]</a> <a href='?src=\ref[src];medrecordadd=`'>\[Add comment\]</a>\n"
if(print_flavor_text()) msg += "[print_flavor_text()]\n"

View File

@@ -634,10 +634,69 @@
usr << "<b>Major Disabilities:</b> [R.fields["ma_dis"]]"
usr << "<b>Details:</b> [R.fields["ma_dis_d"]]"
usr << "<b>Notes:</b> [R.fields["notes"]]"
usr << "<a href='?src=\ref[src];medrecordComment=`'>\[View Comment Log\]</a>"
read = 1
if(!read)
usr << "\red Unable to locate a data core entry for this person."
if (href_list["medrecordComment"])
if(istype(usr, /mob/living/carbon/human))
var/mob/living/carbon/human/H = usr
if(istype(H.glasses, /obj/item/clothing/glasses/hud/health))
var/perpname = "wot"
var/read = 0
if(wear_id)
if(istype(wear_id,/obj/item/weapon/card/id))
perpname = wear_id:registered_name
else if(istype(wear_id,/obj/item/device/pda))
var/obj/item/device/pda/tempPda = wear_id
perpname = tempPda.owner
else
perpname = src.name
for (var/datum/data/record/E in data_core.general)
if (E.fields["name"] == perpname)
for (var/datum/data/record/R in data_core.medical)
if (R.fields["id"] == E.fields["id"])
if(istype(H.glasses, /obj/item/clothing/glasses/hud/health))
read = 1
var/counter = 1
while(R.fields[text("com_[]", counter)])
usr << text("[]", R.fields[text("com_[]", counter)])
counter++
if (counter == 1)
usr << "No comment found"
usr << "<a href='?src=\ref[src];medrecordadd=`'>\[Add comment\]</a>"
if(!read)
usr << "\red Unable to locate a data core entry for this person."
if (href_list["medrecordadd"])
if(istype(usr, /mob/living/carbon/human))
var/mob/living/carbon/human/H = usr
if(istype(H.glasses, /obj/item/clothing/glasses/hud/health))
var/perpname = "wot"
if(wear_id)
if(istype(wear_id,/obj/item/weapon/card/id))
perpname = wear_id:registered_name
else if(istype(wear_id,/obj/item/device/pda))
var/obj/item/device/pda/tempPda = wear_id
perpname = tempPda.owner
else
perpname = src.name
for (var/datum/data/record/E in data_core.general)
if (E.fields["name"] == perpname)
for (var/datum/data/record/R in data_core.medical)
if (R.fields["id"] == E.fields["id"])
if(istype(H.glasses, /obj/item/clothing/glasses/hud/health))
var/t1 = copytext(sanitize(input("Add Comment:", "Med. records", null, null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || src.stat || src.restrained() || !(istype(H.glasses, /obj/item/clothing/glasses/hud/health))))
return
var/counter = 1
while(R.fields[text("com_[]", counter)])
counter++
R.fields[text("com_[]", counter)] = text("Made by [] ([]) on [], 2053<BR>[]",H.get_authentification_name(), H.get_assignment(), time2text(world.realtime, "DDD MMM DD hh:mm:ss"), t1)
..()
return