0

一位客户向我提供了一些树状结构的数据。它只是由是/否问题组成。结尾结果是相对较小的字符串(少于 100 个字符),但一些结尾结果以包含格式的大字符串结尾(制表符、换行符等)。

对于不同的系统,还有不止一个树状结构,所以我需要一种方法来识别它们。我目前只是将所有这些数据解析到一个 json 文件中,但保持大结果的格式往往有点乏味。iOS 5 中的 JSONSerialization 在格式化字符串方面非常挑剔。

无论如何,这是一个例子:

"Skin Assessment":{
    "ID" : "1",
    "Questions":[
                 "Have you completed a skin assessment?",
                 "Does your assessment include Colour, Temperature, Texture, & Turgor?",
                 "Were findings within expected range?"
                 ],
    "Answers":[
               {
               "YES":"",
               "NO":"You must complete the skin assessment prior to documenting your findings."
               },
               {
               "YES":"",
               "NO":"You must complete the skin assessment prior to documenting findings."
               },
               {
               "YES":"Document Colour as: \n\t- Consistent with genetic background\n\t- Pink\n\t- Pale\n\t- mottled\n\t- Cyanotic\n\t- Jaundiced\n\t- Flushed\n\nDocument Temperature/moisture as:\n\t- Warm, dry, intact \n\t- Cool\n\t- Clammy\n\t- Diaphoretic\n\nDocument Texture as:\n\t- Smooth\n\t- Rough \n\t- Dry\n\t- Moist\n\t- Scaly\n\t- Thick or Thin\n\t- Eczema (note colour)\n\t- Lesions (this will require extra documentation such as size, elevation, shape, colour, symmetry) \n\t- Wounds (this will require further documentation such as size, shape, discharge/drainage, dressing)\n\nDocument Turgor as:\n\t- Easily rises\n\t- Immediate return\n\t- Tenting?\n"
               }
               ]
}
4

0 回答 0